From e23bd159b75a2424e6ed1ef7cf9ef2bd4e17fbb1 Mon Sep 17 00:00:00 2001 From: ccbond <1315275049@qq.com> Date: Fri, 11 Aug 2023 00:03:57 +0800 Subject: [PATCH] feat: add internal error --- src/errors/AskCodebaseErrorCode.ts | 2 ++ src/errors/ErrorInternal.ts | 10 ++++++++++ src/errors/index.ts | 1 + 3 files changed, 13 insertions(+) create mode 100644 src/errors/ErrorInternal.ts diff --git a/src/errors/AskCodebaseErrorCode.ts b/src/errors/AskCodebaseErrorCode.ts index 1ae638d..1026400 100644 --- a/src/errors/AskCodebaseErrorCode.ts +++ b/src/errors/AskCodebaseErrorCode.ts @@ -19,4 +19,6 @@ export enum AskCodebaseErrorCode { E10008 = 10008, /** Environment variable not set */ E10009 = 10009, + /** Internal error */ + E10010 = 10010, } diff --git a/src/errors/ErrorInternal.ts b/src/errors/ErrorInternal.ts new file mode 100644 index 0000000..d83b02f --- /dev/null +++ b/src/errors/ErrorInternal.ts @@ -0,0 +1,10 @@ +import { AskCodebaseError } from "./AskCodebaseError"; +import { AskCodebaseErrorCode } from "./AskCodebaseErrorCode"; + +export class ErrorInternal extends AskCodebaseError { + public static code = AskCodebaseErrorCode.E10010; + + constructor(message: string = "Internal error") { + super(ErrorInternal.code, message); + } +} diff --git a/src/errors/index.ts b/src/errors/index.ts index 465e368..2544923 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -9,3 +9,4 @@ export * from "./ErrorGoogleUser"; export * from "./ErrorStateNull"; export * from "./ErrorAuthentication"; export * from "./ErrorEnvVariable"; +export * from "./ErrorInternal";