Skip to content

Commit 98bdb6b

Browse files
committed
chore: ui error handling should be specific to general
Specific errors should be checked before defaulting to a general error handling
1 parent d0f36dc commit 98bdb6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/src/api/errors.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ export const getErrorDetail = (error: unknown): string | undefined => {
115115
return error.detail;
116116
}
117117

118-
if (error instanceof Error) {
119-
return "Please check the developer console for more details.";
120-
}
121-
122118
if (isApiError(error)) {
123119
return error.response.data.detail;
124120
}
@@ -127,6 +123,10 @@ export const getErrorDetail = (error: unknown): string | undefined => {
127123
return error.detail;
128124
}
129125

126+
if (error instanceof Error) {
127+
return "Please check the developer console for more details.";
128+
}
129+
130130
return undefined;
131131
};
132132

0 commit comments

Comments
 (0)