Skip to content

Commit 59745af

Browse files
committed
refactor(site): do not display error details as message
1 parent 45eadfc commit 59745af

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

site/src/api/errors.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ export const mapApiErrorToFieldErrors = (
6161
export const getErrorMessage = (
6262
error: unknown,
6363
defaultMessage: string,
64-
): string =>
65-
isApiError(error)
66-
? error.response.data.message
67-
: error instanceof Error
68-
? error.message
69-
: defaultMessage;
64+
): string => (isApiError(error) ? error.response.data.message : defaultMessage);
7065

7166
/**
7267
*

0 commit comments

Comments
 (0)