Errors and Exceptions: Is there a third option?(clace.io)
clace.io
Errors and Exceptions: Is there a third option?
https://clace.io/blog/errors/
3 comments
Yes, Option type is a special value type.
The solution here is more oriented towards glue code, code which strings together multiple API calls. The attempt is to provide a set -e type error handling for such code.
What I have seen is that some error handling, even if it not perfect, is better than letting errors be ignored.
The solution here is more oriented towards glue code, code which strings together multiple API calls. The attempt is to provide a set -e type error handling for such code.
What I have seen is that some error handling, even if it not perfect, is better than letting errors be ignored.
This started from a discussion thread at https://news.ycombinator.com/item?id=42368065. Created a new topic since this could apply more generally outside of Starlark
Bugs
The solution proposed here looks like setting a thread property on error, and if you don't clear it, then subsequent function calls fail (if I read that right). Personally, I don't love it. I prefer my error handling to be open rather than hidden.