-
Notifications
You must be signed in to change notification settings - Fork 469
fix!: web3 error output fix #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: web3 error output fix #664
Conversation
@@ -25,7 +25,7 @@ public enum Web3Error: Error { | |||
case generalError(err: Error) | |||
case unknownError | |||
|
|||
public var errorDescription: String { | |||
public var errorDescription: String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed type to comply with LocalizedError
protocol and make localizedDescription
return value from errorDescription
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thou it's a bit confusing for me when I've got error messages on my language in console. Also it's usually awfully translated. But anyway, this is must.
|
||
class Web3ErrorTests: XCTestCase { | ||
|
||
func test_web3ErrorReturnsExpectedDescription() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a something, but anyway it's violates camelCase convention of tests naming that is used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
PR contains breaking change! Changed type of
errorDescription: String
toerrorDescription: String?
.This change is easy to "fix" but still it's breaking.
Improved output of the error when calling
error.localizedDescription
and the error is of typeWeb3Error
.Before (useless output):
After (copied log from a test case):