-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Update errors for RawRepresentable types. #277
Conversation
I'm not sure that I'd like to maintain type information while showing the user what the original value was. I liked your original proposal better with this format: |
In this case, the code that causes the error is essentially @tonyd256 is that what you meant? |
Gotcha. Looking through Argo, this is the only place we use |
How about this?
|
Would it be too much to print out all options? Something like: |
Personally, I'm happy to go and look at the enum if I'm not sure of the expected raw values. I think the fact that obtaining the actual raw value required making the request again was the real pain point for me.
I have an enum of ISO 3166-1 country codes that I definitely wouldn't want printed out!
I'm not too familiar with reflection in Swift so can't speak to any performance implications or safety. I've avoided it so far but think the other points I mentioned mean it might not be worth it. |
Ya, I figured that might be a bit much. I like your second suggestion best I think: @gfontenot any thoughts here? |
Yeah, I had the same thought re: using crazy reflection stuff to print out the expected values, but I agree that it's probably overkill and not worth the time/complexity. I think that the proposed solution ( |
Updated! |
Awesome. Merged in as da89baf. |
This aims to close #275.
Using my
Provider
example:Before:
After: