mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-26 16:45:59 +08:00
updated error handling
This commit is contained in:
parent
2c5dde2dda
commit
d19a40fc87
1 changed files with 12 additions and 6 deletions
|
@ -24,13 +24,19 @@ export async function getDataAndInit() {
|
|||
await DB.initSnapshot();
|
||||
} catch (e) {
|
||||
AccountButton.loading(false);
|
||||
Notifications.add(
|
||||
"Could not download user data: " +
|
||||
e.response.data.message +
|
||||
let message = "";
|
||||
|
||||
if (e?.response?.data) {
|
||||
message =
|
||||
"Could not download user data: " +
|
||||
e?.response?.data?.message +
|
||||
" ErrorID: " +
|
||||
e.response.data.errorID,
|
||||
-1
|
||||
);
|
||||
e?.response?.data?.errorID;
|
||||
} else {
|
||||
message = "Could not parse user data: " + e.message;
|
||||
}
|
||||
|
||||
Notifications.add(message, -1);
|
||||
$("#top #menu .account .icon").html('<i class="fas fa-fw fa-times"></i>');
|
||||
$("#top #menu .account").css("opacity", 1);
|
||||
if ($(".pageLoading").hasClass("active")) UI.changePage("");
|
||||
|
|
Loading…
Add table
Reference in a new issue