MCPcopy
hub / github.com/caprover/caprover / createCatcher

Method createCatcher

src/api/ApiStatusCodes.ts:11–29  ·  view source on GitHub ↗
(res: Response)

Source from the content-addressed store, hash-verified

9 }
10
11 static createCatcher(res: Response) {
12 return function (error: CaptainError | any) {
13 if (!error || error.errorStatus !== 404) {
14 Logger.e(error)
15 }
16
17 if (error && error.captainErrorType) {
18 res.send(new BaseApi(error.captainErrorType, error.apiMessage))
19 return
20 }
21
22 if (error && error.errorStatus) {
23 res.sendStatus(Number(error.errorStatus))
24 return
25 }
26
27 res.sendStatus(500)
28 }
29 }
30
31 static readonly STATUS_ERROR_GENERIC = 1000
32 static readonly STATUS_OK = 100

Callers 14

app.tsFile · 0.80
ProjectsRouter.tsFile · 0.80
UserRouter.tsFile · 0.80
AppDataRouter.tsFile · 0.80
ThemesRouter.tsFile · 0.80
SystemRouter.tsFile · 0.80
ProRouter.tsFile · 0.80

Calls 1

eMethod · 0.80

Tested by

no test coverage detected