Replace generic console.error handlers with window.cloudron.onError
This commit is contained in:
@@ -41,7 +41,7 @@ function onOpenNotifications(popover, event, elem) {
|
||||
async function onMarkNotificationRead(notification) {
|
||||
notification.busy = true;
|
||||
const [error] = await notificationModel.update(notification.id, true);
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
await refresh();
|
||||
|
||||
@@ -55,7 +55,7 @@ async function onMarkAllNotificationRead() {
|
||||
await eachLimit(notifications.value, 2, async (notification) => {
|
||||
notification.busy = true;
|
||||
const [error] = await notificationModel.update(notification.id, true);
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
});
|
||||
|
||||
await refresh();
|
||||
@@ -67,7 +67,7 @@ async function onMarkAllNotificationRead() {
|
||||
|
||||
async function refresh() {
|
||||
const [error, result] = await notificationModel.list();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
result.forEach(n => {
|
||||
n.isCollapsed = true;
|
||||
@@ -91,7 +91,7 @@ const platformStatus = ref({
|
||||
let platformTimeoutId = 0;
|
||||
async function trackPlatformStatus() {
|
||||
const [error, result] = await servicesModel.getPlatformStatus();
|
||||
if (error) return console.error('Failed to get platform status.', error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
platformStatus.value = result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user