mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 09:44:21 +01:00
make compact interruptable (#3251)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user