Skip to content

Commit 09e565f

Browse files
committed
feat: add error environment
1 parent 6255c76 commit 09e565f

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/errors/AskCodebaseErrorCode.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ export enum AskCodebaseErrorCode {
1717
E10007 = 10007,
1818
/** Can't get google user by access token */
1919
E10008 = 10008,
20+
/** Environment variable not set */
21+
E10009 = 10009,
2022
}

src/errors/ErrorEnvVariable.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { AskCodebaseError } from "./AskCodebaseError";
2+
import { AskCodebaseErrorCode } from "./AskCodebaseErrorCode";
3+
4+
export class ErrorEnvVariable extends AskCodebaseError {
5+
public static code = AskCodebaseErrorCode.E10009;
6+
7+
constructor(message: string = "Environment variable not set") {
8+
super(ErrorEnvVariable.code, message);
9+
}
10+
}

src/typings/ReqParams.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type ChatRequest = {
2+
project_id: string;
3+
message: string;
4+
};

src/typings/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export * from './IUser'
2-
export * from './JsonResp'
1+
export * from "./IUser";
2+
export * from "./JsonResp";
3+
export * from "./ReqParams";

0 commit comments

Comments
 (0)