Skip to content
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

chore: remove irrelevant custom error handler docs #7143

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions packages/docs/architecture/server-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading