Fix error handling in DeleteSpaceBloc: update failure message to include exception details

This commit is contained in:
Faris Armoush
2025-07-14 14:17:01 +03:00
parent cf1b34ee0a
commit 035c03c6b2

View File

@ -16,7 +16,7 @@ class DeleteSpaceBloc extends Bloc<DeleteSpaceEvent, DeleteSpaceState> {
Future<void> _onDeleteSpace( Future<void> _onDeleteSpace(
DeleteSpace event, DeleteSpace event,
Emitter<DeleteSpaceState> emit Emitter<DeleteSpaceState> emit,
) async { ) async {
emit(DeleteSpaceLoading()); emit(DeleteSpaceLoading());
try { try {
@ -25,7 +25,7 @@ class DeleteSpaceBloc extends Bloc<DeleteSpaceEvent, DeleteSpaceState> {
} on APIException catch (e) { } on APIException catch (e) {
emit(DeleteSpaceFailure(e.message)); emit(DeleteSpaceFailure(e.message));
} catch (e) { } catch (e) {
emit(const DeleteSpaceFailure('Failed to delete space')); emit(DeleteSpaceFailure(e.toString()));
} }
} }
} }