refactoring
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../../../core/utils/logger.dart';
|
||||
@@ -38,6 +39,7 @@ class UnifiedFeedBloc extends Bloc<UnifiedFeedEvent, UnifiedFeedState> {
|
||||
|
||||
emit(UnifiedFeedLoaded(items: items, hasReachedMax: hasReachedMax));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(UnifiedFeedError('Erreur de chargement du flux: $e'));
|
||||
}
|
||||
}
|
||||
@@ -59,6 +61,7 @@ class UnifiedFeedBloc extends Bloc<UnifiedFeedEvent, UnifiedFeedState> {
|
||||
isFetchingMore: false,
|
||||
));
|
||||
} catch (e, st) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
AppLogger.error('UnifiedFeedBloc: chargement supplémentaire échoué', error: e, stackTrace: st);
|
||||
emit(currentState.copyWith(
|
||||
isFetchingMore: false,
|
||||
|
||||
Reference in New Issue
Block a user