Skip to content

Commit 006d5b0

Browse files
committed
fix(createHeadlineBloc): Handle exceptions more robustly
- Replaced errorMessage with exception property. - Improved error handling for unexpected exceptions. - Added UnknownException for better error reporting.
1 parent dbb0566 commit 006d5b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/content_management/bloc/create_headline/create_headline_bloc.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ class CreateHeadlineBloc
178178
emit(
179179
state.copyWith(
180180
status: CreateHeadlineStatus.failure,
181-
errorMessage: e.message,
181+
exception: e,
182182
),
183183
);
184184
} catch (e) {
185185
emit(
186186
state.copyWith(
187187
status: CreateHeadlineStatus.failure,
188-
errorMessage: e.toString(),
188+
exception: UnknownException('An unexpected error occurred: $e'),
189189
),
190190
);
191191
}

0 commit comments

Comments
 (0)