Separate error description vs localizedDescription #730
Labels
area/runtime
Affects: the runtime library.
good first issue
Good for newcomers
kind/bug
Feature doesn't work as expected.
Description
In pure Swift programs it's quite important to not call
.localizedDescription
on random error types -- unless they are verified to be properNSError
s. Unfortunately,ClientError
's description does just that.Consider this Swift program
the output is
See how
localizedDescription
just printsThe operation couldn’t be completed. (TYPE error 1.)
. Even the error number is statically just1
.Bottom line: If I do
print(errorFromOpenAPIRuntime)
I always getThe operation couldn’t be completed. (AsyncHTTPClientError error 1.)
with no further information.Underlying bug is swiftlang/swift#58724
Reproduction
n/a
Package version(s)
latest
Expected behavior
prints the correct error, crucially it must never call
localizedDescription
.Environment
all
Additional information
No response
The text was updated successfully, but these errors were encountered: