-
Notifications
You must be signed in to change notification settings - Fork 114
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 errors so they provide more information #53
Comments
I feel like I made a mistake with throwing an error when |
Actually I (and not only) found it really useful - runtime checks are quite sane in terms of dynamic type nature of JS (in contrast to statically typed Java or Scala). I'll vote for not removing this strict check - it makes Some a great representation of non-nullable value. It makes 'monet' Maybe a great tool for handling I can ask more monet fans - @WojciechP @dumpstate - WDYT ? |
Hello, Sorry, it got lengthy. Bottom line: the library should help the users, and I think keeping |
Ok. I think you've both convinced me. You are right JavaScript is programming in hard mode and we should err on the side of helping out the user. I guess the |
@WojciechP I was about to start writing a PR for this behaviour until I saw this discussion, thanks for the lengthy explanation on why Edit: That being said, I think there should be a better error message, like |
Fixed in #97 |
Now when for example
Some(null);
is called the only information we get with thrown error is"Illegal state exception"
and stack. Would be nice if it informed that it's Monet error and that it's connected with Maybe :)The text was updated successfully, but these errors were encountered: