mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 17:23:20 +03:00
* feat(server): dynamic job concurrency * styling and add setting info to top of the job list * regenerate api * remove DETECT_OBJECT job --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
20 lines
556 B
TypeScript
20 lines
556 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);
|
|
|
|
let serverMessage = (error as ApiError)?.response?.data?.message;
|
|
if (serverMessage) {
|
|
serverMessage = `${String(serverMessage).slice(0, 75)}\n(Immich Server Error)`;
|
|
}
|
|
|
|
notificationController.show({
|
|
message: serverMessage || message,
|
|
type: NotificationType.Error
|
|
});
|
|
}
|