We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f3c82c commit 904d38cCopy full SHA for 904d38c
example/src/main/resources/static/js/errors.js
@@ -32,10 +32,9 @@ export function hideErrorMessage() {
32
alertUi.alert.style.display = "none";
33
}
34
35
-export function showErrorMessage(error) {
36
- const message = "Authentication failed";
+export function showErrorMessage(error, message = "Authentication failed") {
37
const details =
38
- `[Code]\n${error.code}` +
+ `[Code]\n${error.code ?? "UNKNOWN_ERROR"}` +
39
`\n\n[Message]\n${error.message}` +
40
(error.response ? `\n\n[response]\n${JSON.stringify(error.response, null, " ")}` : "");
41
@@ -56,4 +55,4 @@ export async function checkHttpError(response) {
56
55
error.code = response.status;
57
throw error;
58
59
-}
+}
0 commit comments