Throw when creating a replaceable event that doesn't exist yet

This commit is contained in:
Alex Gleason
2024-08-15 16:59:39 -05:00
parent bfa447d250
commit 4db8b2d4fb
3 changed files with 64 additions and 45 deletions

View File

@@ -3,7 +3,11 @@ import { HTTPException } from '@hono/hono/http-exception';
export const errorHandler: ErrorHandler = (err, c) => {
if (err instanceof HTTPException) {
return c.json({ error: err.message }, err.status);
if (err.res) {
return err.res;
} else {
return c.json({ error: err.message }, err.status);
}
}
if (err.message === 'canceling statement due to statement timeout') {