Skip to content

Commit

Permalink
Add error-handler-json (#1360)
Browse files Browse the repository at this point in the history
* Add `error-handler-json`

Replacement for https://github.com/expressjs/api-error-handler

* Add link to more error handling middleware
  • Loading branch information
mifi authored Mar 4, 2024
1 parent 7dcb726 commit f1f986b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions en/guide/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ function errorHandler (err, req, res, next) {
Note that the default error handler can get triggered if you call `next()` with an error
in your code more than once, even if custom error handling middleware is in place.

Other error handling middleware can be found at [Express middleware](/{{ page.lang }}/resources/middleware.html).

## Writing error handlers

Define error-handling middleware functions in the same way as other middleware functions,
Expand Down
1 change: 1 addition & 0 deletions en/resources/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ These are some additional popular middleware modules.
|---------------------------|---------------------|
| [cls-rtracer](https://github.com/puzpuzpuz/cls-rtracer) | Middleware for CLS-based request id generation. An out-of-the-box solution for adding request ids into your logs.|
| [connect-image-optimus](https://github.com/msemenistyi/connect-image-optimus) | Optimize image serving. Switches images to `.webp` or `.jxr`, if possible.|
| [error-handler-json](https://github.com/mifi/error-handler-json) | An error handler for JSON APIs (fork of `api-error-handler`.)|
| [express-debug](https://github.com/devoidfury/express-debug) | Development tool that adds information about template variables (locals), current session, and so on.|
| [express-partial-response](https://github.com/nemtsov/express-partial-response) | Filters out parts of JSON responses based on the `fields` query-string; by using Google API's Partial Response.|
| [express-simple-cdn](https://github.com/jamiesteven/express-simple-cdn) | Use a CDN for static assets, with multiple host support.|
Expand Down

0 comments on commit f1f986b

Please sign in to comment.