Skip to content

Commit

Permalink
consistent default message
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 14, 2025
1 parent 2d5f54c commit a70571a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion playground/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default eventHandler(async (event) => {
return {};
throw createError("foo");
});
2 changes: 1 addition & 1 deletion src/runtime/internal/error/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { defineNitroErrorHandler, setSecurityHeaders } from "./utils";
export default defineNitroErrorHandler(
async function defaultNitroErrorHandler(error, event) {
const statusCode = error.statusCode || 500;
const statusMessage = error.statusMessage || "Internal Server Error";
const statusMessage = error.statusMessage || "Server Error";
// prettier-ignore
const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true }).toString();

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/internal/error/prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineNitroErrorHandler, setSecurityHeaders } from "./utils";
export default defineNitroErrorHandler(
function defaultNitroErrorHandler(error, event) {
const statusCode = error.statusCode || 500;
const statusMessage = error.statusMessage || "Internal Server Error";
const statusMessage = error.statusMessage || "Server Error";
// prettier-ignore
const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true }).toString();

Expand Down Expand Up @@ -33,7 +33,7 @@ export default defineNitroErrorHandler(
statusCode,
statusMessage,
message:
error.unhandled || error.fatal ? "server error" : error.message,
error.unhandled || error.fatal ? "Server Error" : error.message,
data: error.data,
},
null,
Expand Down

0 comments on commit a70571a

Please sign in to comment.