@server/next 0.20.21 → 0.20.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ServerError.js +1 -1
- package/src/index.js +1 -0
package/package.json
CHANGED
package/src/ServerError.js
CHANGED
|
@@ -4,7 +4,7 @@ export default class ServerError extends Error {
|
|
|
4
4
|
message = message(vars);
|
|
5
5
|
}
|
|
6
6
|
for (let key in vars) {
|
|
7
|
-
if (typeof message === "string") {
|
|
7
|
+
if (typeof message === "string" && typeof vars[key] === "string") {
|
|
8
8
|
message = message.replaceAll(`{${key}}`, vars[key]);
|
|
9
9
|
}
|
|
10
10
|
}
|
package/src/index.js
CHANGED
|
@@ -176,6 +176,7 @@ export default function server(options = {}) {
|
|
|
176
176
|
extendWithDefaults(ctx);
|
|
177
177
|
return await handleRequest(this.handlers, ctx);
|
|
178
178
|
} catch (error) {
|
|
179
|
+
console.error(error);
|
|
179
180
|
return new Response(error.message, { status: error.status || 500 });
|
|
180
181
|
}
|
|
181
182
|
};
|