Added error handling notification (#536)

This commit is contained in:
Alex
2022-08-26 10:36:41 -07:00
committed by GitHub
parent 33b810de74
commit 4be9aa091b
10 changed files with 118 additions and 26 deletions

View File

@@ -21,6 +21,10 @@
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
import type { PageData } from './$types';
import { onMount } from 'svelte';
import {
notificationController,
NotificationType
} from '$lib/components/shared-components/notification/notification';
export let data: PageData;
@@ -68,7 +72,10 @@
pushState(selectedAsset.id);
}
} catch (e) {
console.log('Error navigating asset forward', e);
notificationController.show({
type: NotificationType.Info,
message: 'You have reached the end'
});
}
};
@@ -80,7 +87,10 @@
pushState(selectedAsset.id);
}
} catch (e) {
console.log('Error navigating asset backward', e);
notificationController.show({
type: NotificationType.Info,
message: 'You have reached the end'
});
}
};
@@ -176,7 +186,11 @@
clearMultiSelectAssetAssetHandler();
}
} catch (e) {
console.log('Error deleteSelectedAssetHandler', e);
notificationController.show({
type: NotificationType.Error,
message: 'Error deleting assets, check console for more details'
});
console.error('Error deleteSelectedAssetHandler', e);
}
};
</script>