Limit-Status im Upload-Flow anzeigen (Warnbanner + Sperrzustände).

Upload-Fehlercodes auswerten und freundliche Dialoge zeigen.
This commit is contained in:
Codex Agent
2025-11-01 19:50:17 +01:00
parent 2c14493604
commit 79b209de9a
55 changed files with 3348 additions and 462 deletions

View File

@@ -13,3 +13,23 @@ export class ApiError extends Error {
export function isApiError(value: unknown): value is ApiError {
return value instanceof ApiError;
}
export function getApiErrorMessage(error: unknown, fallback: string): string {
if (isApiError(error)) {
if (error.message) {
return error.message;
}
if (error.status && error.status >= 500) {
return 'Der Server hat nicht reagiert. Bitte versuche es später erneut.';
}
return fallback;
}
if (error instanceof Error && error.message) {
return error.message;
}
return fallback;
}