-
Notifications
You must be signed in to change notification settings - Fork 11
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
Unexpected error when default value throws an error #46
Comments
Alright, so looking in to this, I noticed a different issue in Crystal reported here. To solve this for now, we can catch if it raises, but then what happens is instead of getting your "OOPS!", you'll get
That's probably ok for the time being, and at least a lot more helpful. What do you think @matthewmcgarvey ? |
I like that 👍 |
jwoertink
added a commit
that referenced
this issue
Jun 23, 2020
… an exception. We catch that and return nil so Habitat will throw the missing setting error. Fixes #46
jwoertink
added a commit
that referenced
this issue
Jun 25, 2020
Catch when a default value raises an exception
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Say you have a default setting that can fail occasionally (in this example it fails every time but you get the point):
When you call
MyClass.new
, you'd expect the error to raise that comes from the default argument. Instead, you get:The text was updated successfully, but these errors were encountered: