diff options
Diffstat (limited to '')
-rw-r--r-- | .changeset/selfish-parents-leave.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/errors/errors-data.ts | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/.changeset/selfish-parents-leave.md b/.changeset/selfish-parents-leave.md new file mode 100644 index 000000000..206fa08e1 --- /dev/null +++ b/.changeset/selfish-parents-leave.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Improves the error message when a middleware doesn't return a `Response` diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 5a1a5fbcc..047bb5337 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -733,8 +733,9 @@ export const ResponseSentError = { */ export const MiddlewareNoDataOrNextCalled = { name: 'MiddlewareNoDataOrNextCalled', - title: "The middleware didn't return a response or call `next`.", - message: 'The middleware needs to either return a `Response` object or call the `next` function.', + title: "The middleware didn't return a `Response`.", + message: + 'Make sure your middleware returns a `Response` object, either directly or by returning the `Response` from calling the `next` function.', } satisfies ErrorData; /** |