mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): download assets (#3032)
* refactor: download assets * chore: open api * chore: finish tests, make size configurable * chore: defualt to 4GiB * chore: open api * fix: optional archive size * fix: bugs * chore: cleanup
This commit is contained in:
parent
df9c05bef3
commit
ad343b7b32
53 changed files with 1455 additions and 1403 deletions
|
|
@ -4,10 +4,20 @@ import {
|
|||
NotificationType
|
||||
} from '../components/shared-components/notification/notification';
|
||||
|
||||
export function handleError(error: unknown, message: string) {
|
||||
export async function handleError(error: unknown, message: string) {
|
||||
console.error(`[handleError]: ${message}`, error);
|
||||
|
||||
let serverMessage = (error as ApiError)?.response?.data?.message;
|
||||
let data = (error as ApiError)?.response?.data;
|
||||
if (data instanceof Blob) {
|
||||
const response = await data.text();
|
||||
try {
|
||||
data = JSON.parse(response);
|
||||
} catch {
|
||||
data = { message: response };
|
||||
}
|
||||
}
|
||||
|
||||
let serverMessage = data?.message;
|
||||
if (serverMessage) {
|
||||
serverMessage = `${String(serverMessage).slice(0, 75)}\n(Immich Server Error)`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue