-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added processing of accidental context losses * Deleted extra middleware * Added custom errors for more flexible development. Now we response with not only 422 but also with 500 * Major logic of middleware: set status and send response
- Loading branch information
1 parent
07d49b9
commit cc6ff31
Showing
3 changed files
with
33 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
exports.PageNotFoundError = class PageNotFoundError extends Error { | ||
constructor(message="Page not found", ...args) { | ||
super(message, ...args); | ||
this.message = message; | ||
this.name = "PageNotFoundError"; | ||
} | ||
} | ||
|
||
exports.ContextNotFoundError = class ContextNotFoundError extends Error { | ||
constructor(message="Context not found", ...args) { | ||
super(message, ...args); | ||
this.message = message; | ||
this.name = "ContextNotFoundError"; | ||
} | ||
} |
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