make compact interruptable (#3251)

This commit is contained in:
Aiden Cline
2025-10-18 11:49:29 -05:00
committed by GitHub
parent 8da8c9e78c
commit 1f869bccc1
3 changed files with 105 additions and 41 deletions

View File

@@ -59,9 +59,7 @@ const ERRORS = {
description: "Not found",
content: {
"application/json": {
schema: resolver(
Storage.NotFoundError.Schema
)
schema: resolver(Storage.NotFoundError.Schema),
},
},
},
@@ -87,12 +85,9 @@ export namespace Server {
})
if (err instanceof NamedError) {
let status: ContentfulStatusCode
if (err instanceof Storage.NotFoundError)
status = 404
else if (err instanceof Provider.ModelNotFoundError)
status = 400
else
status = 500
if (err instanceof Storage.NotFoundError) status = 404
else if (err instanceof Provider.ModelNotFoundError) status = 400
else status = 500
return c.json(err.toObject(), { status })
}
const message = err instanceof Error && err.stack ? err.stack : err.toString()