Skip to content
Prev Previous commit
Next Next commit
shame
  • Loading branch information
aslilac committed Mar 19, 2024
commit 92a9962a65bc736ff7aa42b9c33b16624d01789b
6 changes: 3 additions & 3 deletions site/src/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export const getValidationErrorMessage = (error: unknown): string => {
};

export const getErrorDetail = (error: unknown): string | undefined | null => {
if (error instanceof Error) {
return `Please check the developer console for more details.`;
}
if (isApiError(error)) {
return error.response.data.detail;
}
if (isApiErrorResponse(error)) {
return error.detail;
}
if (error instanceof Error) {
return `Please check the developer console for more details.`;
}
return null;
};