improved error handling

This commit is contained in:
quenousimporte 2023-12-14 09:54:33 +01:00
parent c6338d1850
commit 0042c85838
1 changed files with 12 additions and 9 deletions

15
main.js
View File

@ -1291,10 +1291,16 @@ function init()
}) })
.catch(err => .catch(err =>
{ {
console.log(err); if (err == "Authent failed")
{
settings.password = prompt("Password: ", settings.password); settings.password = prompt("Password: ", settings.password);
savesettings(); savesettings();
init(); init();
}
else
{
showtemporaryinfo(err);
}
}); });
} }
else else
@ -1387,10 +1393,6 @@ function queryremote(params)
failed("Remote handler returned an error: " + data.error); failed("Remote handler returned an error: " + data.error);
} }
} }
else if (data.warning)
{
console.warn("Remote warning: " + data.warning);
}
else else
{ {
apply(data); apply(data);
@ -1398,7 +1400,8 @@ function queryremote(params)
}) })
.catch( error => .catch( error =>
{ {
failed("Handler result is not valid. JS error: " + error); failed("Could not decrypt or parse data file.");
console.error(error);
}); });
} }
} }