mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-19 21:34:22 +01:00
Throw when creating a replaceable event that doesn't exist yet
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user