From 856efcfa79f376c04929abe870ad040fec89edf4 Mon Sep 17 00:00:00 2001 From: Nils-Johan Gynther Date: Wed, 22 Apr 2026 21:33:03 +0200 Subject: [PATCH] fix(import): enhance error handling with localized messages for unauthorized and forbidden responses --- .../lib/features/import/data/import_repository.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flutter/lib/features/import/data/import_repository.dart b/flutter/lib/features/import/data/import_repository.dart index ef183ded..b7bb8f6a 100644 --- a/flutter/lib/features/import/data/import_repository.dart +++ b/flutter/lib/features/import/data/import_repository.dart @@ -96,10 +96,16 @@ class ImportRepository { 'Import misslyckades (${response.statusCode}).'; if (response.statusCode == 401) { - throw ApiException(type: ApiErrorType.unauthorized, statusCode: 401); + throw ApiException( + type: ApiErrorType.unauthorized, + statusCode: 401, + message: 'Inte inloggad.'); } if (response.statusCode == 403) { - throw ApiException(type: ApiErrorType.forbidden, statusCode: 403); + throw ApiException( + type: ApiErrorType.forbidden, + statusCode: 403, + message: 'Ã…tkomst nekad.'); } if (response.statusCode >= 500) { throw ApiException(