mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
14 lines
411 B
TypeScript
14 lines
411 B
TypeScript
|
import { ApiError } from '../../api';
|
||
|
import {
|
||
|
notificationController,
|
||
|
NotificationType
|
||
|
} from '../components/shared-components/notification/notification';
|
||
|
|
||
|
export function handleError(error: unknown, message: string) {
|
||
|
console.error(`[handleError]: ${message}`, error);
|
||
|
notificationController.show({
|
||
|
message: (error as ApiError)?.response?.data?.message || message,
|
||
|
type: NotificationType.Error
|
||
|
});
|
||
|
}
|