Skip to content

Commit 0362b09

Browse files
committed
refactor(settings): Update SettingsBloc to emit HtHttpException
1 parent d3a8c1e commit 0362b09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/settings/bloc/settings_bloc.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
5656
emit(SettingsLoadSuccess(userAppSettings: defaultSettings));
5757
} on HtHttpException catch (e) {
5858
emit(
59-
SettingsLoadFailure(e.message, userAppSettings: state.userAppSettings),
59+
SettingsLoadFailure(e, userAppSettings: state.userAppSettings),
6060
);
6161
} catch (e) {
6262
emit(
6363
SettingsLoadFailure(
64-
'An unexpected error occurred: $e',
64+
UnknownException('An unexpected error occurred: $e'),
6565
userAppSettings: state.userAppSettings,
6666
),
6767
);
@@ -82,14 +82,14 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
8282
} on HtHttpException catch (e) {
8383
emit(
8484
SettingsUpdateFailure(
85-
e.message,
85+
e,
8686
userAppSettings: state.userAppSettings,
8787
),
8888
);
8989
} catch (e) {
9090
emit(
9191
SettingsUpdateFailure(
92-
'An unexpected error occurred: $e',
92+
UnknownException('An unexpected error occurred: $e'),
9393
userAppSettings: state.userAppSettings,
9494
),
9595
);

0 commit comments

Comments
 (0)