Archived
1
0

Expose HttpError to plugins

This will let them throw and show nice errors more easily.
This commit is contained in:
Asher
2021-01-29 17:42:50 -06:00
parent 22d194515a
commit c78f56b334
4 changed files with 26 additions and 0 deletions

View File

@ -19,6 +19,9 @@ export const plugin: cs.Plugin = {
r.get("/goland/icon.svg", (_, res) => {
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
})
r.get("/error", () => {
throw new cs.HttpError("error", cs.HttpCode.LargePayload)
})
return r
},