fix test typings

This commit is contained in:
dswbx
2025-03-11 09:38:14 +01:00
parent eb451a8e1a
commit 0dd29c3b07
4 changed files with 19 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { Exception } from "core";
import { Exception, isDebug } from "core";
import { type Static, StringEnum, Type } from "core/utils";
import { cors } from "hono/cors";
import { Module } from "modules/Module";
@@ -102,6 +102,12 @@ export class AppServer extends Module<typeof serverConfigSchema> {
return c.json(err.toJSON(), err.code as any);
}
if (err instanceof Error) {
if (isDebug()) {
return c.json({ error: err.message, stack: err.stack }, 500);
}
}
return c.json({ error: err.message }, 500);
});
this.setBuilt();