Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e02863022 | |||
| 90c2134bbe |
@@ -14,6 +14,10 @@ function errorResponse(error: unknown): Response {
|
|||||||
return json({ ok: false, error: error.message }, { status: error.status });
|
return json({ ok: false, error: error.message }, { status: error.status });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error instanceof Error && error.name === "AbortError") {
|
||||||
|
return json({ ok: false, error: "Request aborted" }, { status: 499 });
|
||||||
|
}
|
||||||
|
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return json({ ok: false, error: "Internal server error" }, { status: 500 });
|
return json({ ok: false, error: "Internal server error" }, { status: 500 });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user