Skip to content

Commit 904d38c

Browse files
committed
Use default error title and error code
1 parent 1f3c82c commit 904d38c

File tree

1 file changed

+3
-4
lines changed
  • example/src/main/resources/static/js

1 file changed

+3
-4
lines changed

example/src/main/resources/static/js/errors.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ export function hideErrorMessage() {
3232
alertUi.alert.style.display = "none";
3333
}
3434

35-
export function showErrorMessage(error) {
36-
const message = "Authentication failed";
35+
export function showErrorMessage(error, message = "Authentication failed") {
3736
const details =
38-
`[Code]\n${error.code}` +
37+
`[Code]\n${error.code ?? "UNKNOWN_ERROR"}` +
3938
`\n\n[Message]\n${error.message}` +
4039
(error.response ? `\n\n[response]\n${JSON.stringify(error.response, null, " ")}` : "");
4140

@@ -56,4 +55,4 @@ export async function checkHttpError(response) {
5655
error.code = response.status;
5756
throw error;
5857
}
59-
}
58+
}

0 commit comments

Comments
 (0)