Replace generic console.error handlers with window.cloudron.onError
This commit is contained in:
@@ -42,7 +42,7 @@ async function waitForTask(id) {
|
||||
if (!id) return;
|
||||
|
||||
const [error, result] = await tasksModel.get(id);
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
// task done, refresh menu
|
||||
if (!result.active) {
|
||||
@@ -57,7 +57,7 @@ async function onCheck() {
|
||||
busyCheck.value = true;
|
||||
|
||||
const [error] = await appsModel.checkUpdate(props.app.id);
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
busyCheck.value = false;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ async function onUpdate() {
|
||||
if (error) {
|
||||
busyUpdate.value = false;
|
||||
if (error.status === 400) updateError.value = error.body ? error.body.message : 'Internal error';
|
||||
return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
}
|
||||
|
||||
dialog.value.close();
|
||||
@@ -89,7 +89,7 @@ onMounted(async () => {
|
||||
autoUpdatesEnabled.value = props.app.enableAutomaticUpdate;
|
||||
|
||||
const [error, result] = await profileModel.get();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
profile.value = result;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user