From 39b17a40d34544fc7309620fc8e9384d8c6afcac Mon Sep 17 00:00:00 2001 From: Bartosz Herba Date: Mon, 29 Apr 2024 09:45:56 +0200 Subject: [PATCH] chore: remove irrelevant custom error handler docs --- .../docs/architecture/server-middleware.md | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/packages/docs/architecture/server-middleware.md b/packages/docs/architecture/server-middleware.md index a62a211a09..920895b870 100644 --- a/packages/docs/architecture/server-middleware.md +++ b/packages/docs/architecture/server-middleware.md @@ -83,26 +83,3 @@ export default { + } } ``` -## Customize the error handler - -The Server Middleware comes with a default error handler that logs errors to the console and sends a generic error response to the client. You can customize this behavior by providing your own error handler function in the `middleware.config.js` file: - -```javascript -module.exports = { - integrations: { - ct: { - location: '@vsf-enterprise/commercetools-api/server', - errorHandler: ( - error: unknown, /** Error thrown by API method */ - req: Request, /** Express Request object */ - res: Response /** Express Response object */ - ) => { - res.status(404); - res.send('Custom not-found error handler'); - }, - configuration: { ... }, - ... - // remaining configuration -``` - -Custom error handler are configured per integration, so you can have different error handlers for different integrations.