Skip to content
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

Localizederror conformance #33

Merged
merged 3 commits into from
Sep 18, 2019

Conversation

pteasima
Copy link
Contributor

@pteasima pteasima commented Jul 21, 2019

Adds conformance to LocalizedError for any Tagged that wraps an Error. This is the only way I could find to get localizedDescription working.

@pteasima
Copy link
Contributor Author

This is an altenative to #32

return rawValue.localizedDescription
}
public var failureReason: String? {
return (rawValue as? LocalizedError)?.failureReason
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to conform for any RawValue: Error, but still want to maintaing expected behavior for RawValue: LocalizedError, thus the casts.

Copy link
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the deep exploration into making tagged errors even better! This looks like the most ideal solution given the issues you encountered. We're happy to merge this as is and will keep an eye on compatibility over the next releases.

@mbrandonw mbrandonw merged commit 07aaa93 into pointfreeco:master Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants