@server/next 0.20.21 → 0.20.22

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@server/next",
3
- "version": "0.20.21",
3
+ "version": "0.20.22",
4
4
  "description": "An experimental reimplementation of server.js focused on the DX",
5
5
  "homepage": "https://node-server.com/",
6
6
  "repository": "https://github.com/franciscop/server-next.git",
@@ -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
  };