Skip to content

Commit

Permalink
have humanReadableError return strings verbatim
Browse files Browse the repository at this point in the history
If typeof error === 'string', then obviously the string `error` is the
error we should be returning.
  • Loading branch information
chennisden committed Aug 6, 2024
1 parent 99966c5 commit 1b704e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/constants/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export const BACKEND_URL =

// eslint-disable-next-line
export const humanReadableError = (error: any | undefined) => {
if (isAxiosError(error)) {
if (typeof error === "string") {
return error;
} else if (isAxiosError(error)) {
const axiosError = error as AxiosError;
const request = axiosError.request,
response = axiosError.response;
Expand Down

0 comments on commit 1b704e0

Please sign in to comment.