-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improves logging for explicitly handled errors (#694)
Amphora provides a mechanism to supply an error status code and message in a response. This is accomplished by setting the following properties on an **Error**: ```js const err = new Error('Invalid Request'); err.status = 400; err.message = 'Invalid Request'; throw err; ``` Errors thrown in a model's `render` or `save` will make their way to the main error handler defined in `lib/responses.js`. Prior to this commit, those errors were not logged, leaving the logging up to the implementer. Co-authored-by: Tiffany Chow <[email protected]>
- Loading branch information
1 parent
4ae09c6
commit 97386a1
Showing
5 changed files
with
70 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters