loading state and error handling refactor
This commit is contained in:
+4
-2
@@ -2,6 +2,7 @@ import 'dart:developer';
|
||||
|
||||
import 'package:hydrated_bloc/hydrated_bloc.dart';
|
||||
|
||||
import '../../../../../api/errors/error_mapper.dart';
|
||||
import '../../loadableState/loading_error.dart';
|
||||
import '../../repository/repository.dart';
|
||||
import 'loadable_hydrated_bloc_event.dart';
|
||||
@@ -78,8 +79,9 @@ abstract class LoadableHydratedBloc<
|
||||
(e) {
|
||||
log('Error while fetching ${TState.toString()}: ${e.toString()}');
|
||||
add(Error(LoadingError(
|
||||
message: e.message ?? e.toString(),
|
||||
allowRetry: true,
|
||||
message: errorToUserMessage(e),
|
||||
technicalDetails: errorToTechnicalDetails(e),
|
||||
allowRetry: errorAllowsRetry(e),
|
||||
)));
|
||||
},
|
||||
).then((value) {
|
||||
|
||||
Reference in New Issue
Block a user