You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a library that unfortunately does logger[metadataKey: "request.error"] = .string(error.localizedDescription) where the error is an error out of AHC. The result is that it always prints
request.error=The operation couldn’t be completed. (AsyncHTTPClient.HTTPClientError error 1.)
Note that error 1 is produced regardless of the actual error.
The source of the problem is this oddity in Swift/Foundation:
import Foundation
struct MyError: Error & CustomStringConvertible { var description: String { "hello" } }
print((MyError() as Error).localizedDescription)
// produces: "The operation couldn’t be completed. (MyError error 1.)"