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

Allow TypeError to be stored as value in record with "Any" field type #42

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

jharris4
Copy link
Contributor

We just noticed in our project that we're storing the result of a whatwg fetch loading error in our typed-immutable records, and the fact that the error is an instance of TypeError was causing things to blow up, even though the field was set to allow typed.Any.

This PR fixes that issue, and adds some unit tests to verify the fix.

@stutrek
Copy link
Member

stutrek commented Feb 16, 2017

👍 good edge case, good tests, good testing of the edge case.

Does anyone see any value in a NotError type or maybe a Not(Error)? It seems like you'd usually want to catch the error earlier, but maybe someone has a good use case.

@lukesneeringer you've contributed the most, please give us a review.

@lukesneeringer
Copy link
Contributor

Hey, nice. Approved.

Does anyone see any value in a NotError type or maybe a Not(Error)? It seems like you'd usually want to catch the error earlier, but maybe someone has a good use case.

We can wait until someone needs it for something. My guess is it will never come up.

@lukesneeringer lukesneeringer merged commit 44c2a0a into typed-immutable:master Feb 16, 2017
@stutrek
Copy link
Member

stutrek commented Feb 23, 2017

Published just now. Thanks!

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.

None yet

3 participants