-
Notifications
You must be signed in to change notification settings - Fork 10
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
Create error-handling.md #14
Conversation
|
||
## What is error handling? | ||
|
||
Applications have a expected flow, and due to external circumstances sometimes will deviate from this flow. This deviation is considered an error and has to be handled accordingly. We dive into this handling later in this spec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/a expected/an expected/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't really a spec, maybe "guide"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduction makes it seem like errors are out of our control. I might consider removing this section and leading off with the definition of "error" i.e. the "what types of errors are there" section.
@templaedhel this needs some love. there are lots of TBD's around herer |
@mohit - thanks for reminder. this has been on the backburner for awhile but I will take a look asap. |
Across different programming languages, there are a variety of approaches to handle errors. I focus on the paradigms we've adopted at Clever based on our infrastructure (AWS, Heroku) and coding languages (CoffeeScript, Python, Go). | ||
|
||
1. CoffeeScript/Javascript | ||
- `Error` You can subclass the builtin Error class and throw different types of errors depending on the type of failure. You can then detect where a failure came from in a central error handler. Careful doing this though, there are [gotchas](https://github.com/Clever/clever-api/pull/155). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a private link, so we should probably replace this with a link to a public version of this comment. maybe a blog post?
@nathanleiby To add some final comments and tweaks, other opinions welcome.