Replace generic console.error handlers with window.cloudron.onError
This commit is contained in:
@@ -65,7 +65,7 @@ const archives = ref([]);
|
||||
|
||||
async function refreshArchives() {
|
||||
const [error, result] = await archivesModel.list();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
// ensure we use the full api oprigin
|
||||
result.forEach(a => {
|
||||
@@ -89,7 +89,7 @@ async function onRemove(archive) {
|
||||
if (!yes) return;
|
||||
|
||||
const [error] = await archivesModel.remove(archive.id);
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
await refreshArchives();
|
||||
}
|
||||
@@ -102,7 +102,7 @@ async function onRestore(archive) {
|
||||
|
||||
async function onDownloadConfig(archive) {
|
||||
const [backupConfigError, backupConfig] = await backupSitesModel.generateBackupConfig(archive);
|
||||
if (backupConfigError) return console.error(backupConfigError);
|
||||
if (backupConfigError) return window.cloudron.onError(backupConfigError);
|
||||
|
||||
const filename = `${archive.appConfig.fqdn}-archive-config-${(new Date(archive.creationTime)).toISOString().split('T')[0]}.json`;
|
||||
download(filename, JSON.stringify(backupConfig, null, 4));
|
||||
|
||||
Reference in New Issue
Block a user