summaryrefslogtreecommitdiff
path: root/src/server/api/error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/error.ts')
-rw-r--r--src/server/api/error.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/api/error.ts b/src/server/api/error.ts
index ca441d5811..cb0bdc9f47 100644
--- a/src/server/api/error.ts
+++ b/src/server/api/error.ts
@@ -1,3 +1,5 @@
+type E = { message: string, code: string, id: string, kind?: 'client' | 'server', httpStatusCode?: number };
+
export class ApiError extends Error {
public message: string;
public code: string;
@@ -6,7 +8,7 @@ export class ApiError extends Error {
public httpStatusCode?: number;
public info?: any;
- constructor(e?: { message: string, code: string, id: string, kind?: 'client' | 'server', httpStatusCode?: number }, info?: any) {
+ constructor(e?: E | null | undefined, info?: any | null | undefined) {
if (e == null) e = {
message: 'Internal error occurred. Please contact us if the error persists.',
code: 'INTERNAL_ERROR',