Skip to content

Commit

Permalink
Update error-handling.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pwizla authored Oct 19, 2022
1 parent dc8273c commit 53f13cc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Errors thrown by the GraphQL API are included in the [response](/developer-docs/

## Throwing errors

### Controllers & Middlewares
### Controllers and middlewares

The recommended way to throw errors when developing any custom logic with Strapi is to have the [controller](/developer-docs/latest/development/backend-customization/controllers.md) or [middleware](/developer-docs/latest/development/backend-customization/) respond with the correct status and body.

Expand Down Expand Up @@ -133,7 +133,7 @@ export default async (ctx, next) => {
</code-block>
</code-group>

### Services and Model Lifecycles
### Services and models lifecycles

Once you are working at a deeper layer than the controllers or middlewares there are dedicated error classes that can be used to throw errors. These classes are extensions of [Node `Error` class](https://nodejs.org/api/errors.html#errors_class_error) and are specifically targeted for certain use-cases.

Expand Down

0 comments on commit 53f13cc

Please sign in to comment.