mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-30 05:44:54 +00:00
Refactor API error handling and add try-catch blocks
Added try-catch blocks for error handling in API's files to rethrow the errors to the cubit so cubits can update the UI based on them. Refactored error handling in HTTPInterceptor and HTTPService classes.
This commit is contained in:
@ -12,10 +12,8 @@ class SceneCubit extends Cubit<SceneState> {
|
||||
|
||||
void getScenes() {
|
||||
emit(SceneLoading());
|
||||
//TODO: remove this it's causing the Bad State because its being after the cubit is closed
|
||||
Future.delayed(const Duration(milliseconds: 50), () {
|
||||
emit(SceneSuccess());
|
||||
});
|
||||
|
||||
emit(SceneSuccess());
|
||||
}
|
||||
|
||||
List<SceneModel> scenes = [];
|
||||
|
||||
Reference in New Issue
Block a user