mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 18:34:24 +01:00
feat(client): detect communication errors with Traefik
This commit is contained in:
parent
230def10fe
commit
d95450ae07
@ -275,10 +275,19 @@ async function reportError(method: string, url: string, statusCode: number, resp
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const { t } = await import("./i18n.js");
|
const { t } = await import("./i18n.js");
|
||||||
toastService.showErrorTitleAndMessage(
|
if (statusCode === 400 && (url.includes("%23") || url.includes("%2F"))) {
|
||||||
t("server.unknown_http_error_title"),
|
toastService.showPersistent({
|
||||||
t("server.unknown_http_error_content", { statusCode, method, url, message: messageStr }),
|
id: "trafik-blocked",
|
||||||
15_000);
|
icon: "bx bx-unlink",
|
||||||
|
title: t("server.unknown_http_error_title"),
|
||||||
|
message: t("server.traefik_blocks_requests")
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
toastService.showErrorTitleAndMessage(
|
||||||
|
t("server.unknown_http_error_title"),
|
||||||
|
t("server.unknown_http_error_content", { statusCode, method, url, message: messageStr }),
|
||||||
|
15_000);
|
||||||
|
}
|
||||||
const { throwError } = await import("./ws.js");
|
const { throwError } = await import("./ws.js");
|
||||||
throwError(`${statusCode} ${method} ${url} - ${message}`);
|
throwError(`${statusCode} ${method} ${url} - ${message}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2110,6 +2110,7 @@
|
|||||||
},
|
},
|
||||||
"server": {
|
"server": {
|
||||||
"unknown_http_error_title": "Communication error with the server",
|
"unknown_http_error_title": "Communication error with the server",
|
||||||
"unknown_http_error_content": "Status code: {{statusCode}}\nURL: {{method}} {{url}}\nMessage: {{message}}"
|
"unknown_http_error_content": "Status code: {{statusCode}}\nURL: {{method}} {{url}}\nMessage: {{message}}",
|
||||||
|
"traefik_blocks_requests": "If you are using the Traefik reverse proxy, it introduced a breaking change which affects the communication with the server."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user