diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-02-23 11:20:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-23 11:20:58 +0900 |
| commit | 52774bbe6402aee076b2e0648bd1f4764924da8a (patch) | |
| tree | a0e3f34ce6d000dd880a6a6c152e98e139076a14 /src/server/api/error.ts | |
| parent | 投稿を削除したときにお気に入りからも削除するように (diff) | |
| download | sharkey-52774bbe6402aee076b2e0648bd1f4764924da8a.tar.gz sharkey-52774bbe6402aee076b2e0648bd1f4764924da8a.tar.bz2 sharkey-52774bbe6402aee076b2e0648bd1f4764924da8a.zip | |
Introduce OpenAPI specs (#4351)
* wip
* wip
* wip
* Update index.ts
* Update gen-openapi-spec.ts
* Update api.ja-JP.md
* Fix
* Improve doc
* Update gen-openapi-spec.ts
* Update redoc.html
* Improve doc
* Update gen-openapi-spec.ts
* Improve doc
* Update CHANGELOG.md
Diffstat (limited to 'src/server/api/error.ts')
| -rw-r--r-- | src/server/api/error.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/api/error.ts b/src/server/api/error.ts index 6b5c44cac2..ca441d5811 100644 --- a/src/server/api/error.ts +++ b/src/server/api/error.ts @@ -3,14 +3,16 @@ export class ApiError extends Error { public code: string; public id: string; public kind: string; + public httpStatusCode?: number; public info?: any; - constructor(e?: { message: string, code: string, id: string, kind?: 'client' | 'server' }, info?: any) { + constructor(e?: { message: string, code: string, id: string, kind?: 'client' | 'server', httpStatusCode?: number }, info?: any) { if (e == null) e = { message: 'Internal error occurred. Please contact us if the error persists.', code: 'INTERNAL_ERROR', id: '5d37dbcb-891e-41ca-a3d6-e690c97775ac', - kind: 'server' + kind: 'server', + httpStatusCode: 500 }; super(e.message); @@ -18,6 +20,7 @@ export class ApiError extends Error { this.code = e.code; this.id = e.id; this.kind = e.kind || 'client'; + this.httpStatusCode = e.httpStatusCode; this.info = info; } } |