From c9b2ad075864e3402ffefd74dfdf617490d59ca4 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 6 Feb 2023 15:23:52 +0100 Subject: [PATCH 1/2] Fix broken links reported in issue #1423 --- .../latest/developer-resources/error-handling.md | 4 ++-- .../developer-docs/latest/developer-resources/unit-testing.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developer-docs/latest/developer-resources/error-handling.md b/docs/developer-docs/latest/developer-resources/error-handling.md index 71927b73c8..12de7a6302 100644 --- a/docs/developer-docs/latest/developer-resources/error-handling.md +++ b/docs/developer-docs/latest/developer-resources/error-handling.md @@ -63,7 +63,7 @@ Errors thrown by the GraphQL API are included in the [response](/developer-docs/ ### 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. +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.md) respond with the correct status and body. This can be done by calling an error function on the context (i.e. `ctx`). Available error functions are listed in the [http-errors documentation](https://github.com/jshttp/http-errors#list-of-all-constructors) but their name should be lower camel-cased to be used by Strapi (e.g. `badRequest`). @@ -367,7 +367,7 @@ throw new PolicyError('Something went wrong', { policy: 'my-policy' }); ::: tab Pagination -The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters: +The `PaginationError` class is a specific error class that is typically used when parsing the pagination information from [REST](/developer-docs/latest/developer-resources/database-apis-reference/rest/sort-pagination.md#pagination), [GraphQL](/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md#pagination), or the [Entity Service](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md#pagination). It accepts the following parameters: | Parameter | Type | Description | Default | | --- | --- | --- | --- | diff --git a/docs/developer-docs/latest/developer-resources/unit-testing.md b/docs/developer-docs/latest/developer-resources/unit-testing.md index d63531c26f..6c1557d5a0 100644 --- a/docs/developer-docs/latest/developer-resources/unit-testing.md +++ b/docs/developer-docs/latest/developer-resources/unit-testing.md @@ -96,7 +96,7 @@ module.exports = ({ env }) => ({ ### Strapi instance In order to test anything we need to have a strapi instance that runs in the testing environment, -basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](process-manager.md). +basically we want to get instance of strapi app as object, similar like creating an instance for [process manager](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/process-manager.md). These tasks require adding some files - let's create a folder `tests` where all the tests will be put and inside it, next to folder `helpers` where main Strapi helper will be in file strapi.js. From d885ca8031caf6862dc0104a351db2c00e5dae7d Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Mon, 6 Feb 2023 15:29:14 +0100 Subject: [PATCH 2/2] Fix BE custom. > middlewares link --- .../developer-docs/latest/developer-resources/error-handling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/developer-resources/error-handling.md b/docs/developer-docs/latest/developer-resources/error-handling.md index 12de7a6302..b5a816f9df 100644 --- a/docs/developer-docs/latest/developer-resources/error-handling.md +++ b/docs/developer-docs/latest/developer-resources/error-handling.md @@ -63,7 +63,7 @@ Errors thrown by the GraphQL API are included in the [response](/developer-docs/ ### 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.md) respond with the correct status and body. +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/middlewares.md) respond with the correct status and body. This can be done by calling an error function on the context (i.e. `ctx`). Available error functions are listed in the [http-errors documentation](https://github.com/jshttp/http-errors#list-of-all-constructors) but their name should be lower camel-cased to be used by Strapi (e.g. `badRequest`).