Skip to content

Commit b8bea99

Browse files
committed
ignore empty detail fields
1 parent 98bdb6b commit b8bea99

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

site/src/api/errors.ts

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

118-
if (isApiError(error)) {
118+
// APIErrors that are empty still benefit from checking the
119+
// developer console if no detail is provided. So only use the
120+
// detail field if it is not empty.
121+
if (isApiError(error) && error.response.data.detail) {
119122
return error.response.data.detail;
120123
}
121124

122-
if (isApiErrorResponse(error)) {
125+
if (isApiErrorResponse(error) && error.detail) {
123126
return error.detail;
124127
}
125128

0 commit comments

Comments
 (0)