diff --git a/app/lib/bloc/scan_account_dir.dart b/app/lib/bloc/scan_account_dir.dart index cede129d..297ff5fa 100644 --- a/app/lib/bloc/scan_account_dir.dart +++ b/app/lib/bloc/scan_account_dir.dart @@ -208,7 +208,15 @@ class ScanAccountDirBloc } stopwatch.reset(); - final hasUpdate = await _syncOnline(ev); + final bool hasUpdate; + try { + hasUpdate = await _syncOnline(ev); + } catch (e, stackTrace) { + _log.shout("[_onEventQuery] Exception while request", e, stackTrace); + emit(ScanAccountDirBlocFailure( + cacheFiles.where((f) => file_util.isSupportedFormat(f)).toList(), e)); + return; + } _log.info( "[_onEventQuery] Elapsed time (_syncOnline): ${stopwatch.elapsedMilliseconds}ms, hasUpdate: $hasUpdate"); if (hasUpdate) {