Open
Description
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.)"
Metadata
Metadata
Assignees
Labels
No labels