@@ -71,29 +71,55 @@ export interface DsheetProps {
7171 onDuneChartEmbed ?: ( ) => void ;
7272 onSheetCountChange ?: ( sheetCount : number ) => void ;
7373}
74- type BaseError = {
74+ export type BaseError = {
7575 message : string ;
7676 functionName ?: string ;
77- type : string ;
77+ type : `${ ERROR_MESSAGES_FLAG } ` ;
7878} ;
7979
80- type CustomError = BaseError & {
80+ export type CustomError = BaseError & {
8181 type : typeof ERROR_MESSAGES_FLAG . CUSTOM ;
8282 reason : string ;
8383} ;
8484
85+ export type InvalidParamError = BaseError & {
86+ type : typeof ERROR_MESSAGES_FLAG . INVALID_PARAM ;
87+ } ;
88+
89+ export type MissingKeyError = BaseError & {
90+ type : typeof ERROR_MESSAGES_FLAG . MISSING_KEY ;
91+ } ;
92+
93+ export type EnsResolveError = BaseError & {
94+ type : typeof ERROR_MESSAGES_FLAG . ENS ;
95+ } ;
96+
97+ export type InvalidApiKeyError = BaseError & {
98+ type : typeof ERROR_MESSAGES_FLAG . INVALID_API_KEY ;
99+ apiKeyName ?: string ;
100+ } ;
101+
102+ export type RateLimitError = BaseError & {
103+ type : typeof ERROR_MESSAGES_FLAG . RATE_LIMIT ;
104+ apiKeyName ?: string ;
105+ } ;
106+
85107export type NetworkError = BaseError & {
86- type :
87- | typeof ERROR_MESSAGES_FLAG . NETWORK_ERROR
88- | typeof ERROR_MESSAGES_FLAG . RATE_LIMIT ;
108+ type : typeof ERROR_MESSAGES_FLAG . NETWORK_ERROR ;
109+ apiKeyName ?: string ;
89110} ;
90111
91112export type DefaultError = BaseError & {
113+ type : typeof ERROR_MESSAGES_FLAG . DEFAULT ;
92114 reason : string ;
93115} ;
94116
95117export type ErrorMessageHandlerReturnType =
96- | BaseError
97- | CustomError
118+ | InvalidParamError
119+ | MissingKeyError
120+ | RateLimitError
98121 | NetworkError
122+ | EnsResolveError
123+ | InvalidApiKeyError
124+ | CustomError
99125 | DefaultError ;
0 commit comments