Skip to content

errorListener not catching all errors #912

@krll-kov

Description

@krll-kov
PathAccessException: Cannot delete file, path = 'C:\Users\7636~1\AppData\Local\Temp\libCachedImageData\a1ae03b0-5abe-1dd1-8533-276b5a6910cc.png' (OS Error: Отказано в доступе., errno = 5); 
#0      _checkForErrorResponse (dart:io/common.dart:55)
#1      _File._delete.<anonymous closure> (dart:io/file_impl.dart:315)<asynchronous suspension>
#2      ForwardingFileSystemEntity.delete (package:file/src/forwarding/forwarding_file_system_entity.dart:66)<asynchronous suspension>
#3      CacheStore._removeCachedFile (package:flutter_cache_manager/src/cache_store.dart:187)<asynchronous suspension>
PathNotFoundException: Cannot delete file, path = 'C:\Users\7636~1\AppData\Local\Temp\libCachedImageData\2ed44830-61ef-1dd1-8533-276b5a6910cc.png' (OS Error: Не удается найти указанный файл., errno = 2); 
#0      _checkForErrorResponse (dart:io/common.dart:55)
#1      _File._delete.<anonymous closure> (dart:io/file_impl.dart:315)<asynchronous suspension>
#2      ForwardingFileSystemEntity.delete (package:file/src/forwarding/forwarding_file_system_entity.dart:66)<asynchronous suspension>
#3      CacheStore._removeCachedFile (package:flutter_cache_manager/src/cache_store.dart:187)<asynchronous suspension>
Exception: Invalid image data; #0      _futurize (dart:ui/painting.dart:6950)
#1      ImageDescriptor.encoded (dart:ui/painting.dart:6764)
#2      instantiateImageCodecWithSize (dart:ui/painting.dart:2307)
#3      FileImage._loadAsync (package:flutter/src/painting/image_provider.dart:1598)<asynchronous suspension>
FormatException: Unexpected character (at character 1)                                                                           ...^; 
#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383)
#1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250)
#2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915)
#3      _parseJson (dart:convert-patch/convert_patch.dart:35)
#4      JsonDecoder.convert (dart:convert/json.dart:610)
#5      JsonCodec.decode (dart:convert/json.dart:216)
#6      jsonDecode (dart:convert/json.dart:155)
#7      JsonCacheInfoRepository._readFile (package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart:143)<asynchronous suspension>
#8      JsonCacheInfoRepository.open (package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart:40)<asynchronous suspension>
#9      CacheStore._getCacheDataFromDatabase (package:flutter_cache_manager/src/cache_store.dart:112)<asynchronous suspension>
FileSystemException: writeFrom failed, path = 'C:\Users\1\AppData\Roaming\com.swiftsoft\ExLoader\libCachedImageData.json' (OS Error: Недостаточно места на диске., errno = 112); 
#0      _checkForErrorResponse (dart:io/common.dart:55)
#1      _RandomAccessFile.writeFrom.<anonymous closure> (dart:io/file_impl.dart:884)<asynchronous suspension>
#2      JsonCacheInfoRepository._saveFile (package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart:191)<asynchronous suspension>
FormatException: Unexpected character (at character 10837)...40823130,"length":1451183,"_id":36}]{"url":"https://data.exloader.net/im...

Hi, i've added an errors listener as mentioned in the update-log:
image
but it does not catch all errors and still throw a lot of stuff to PlatformDispatcher.instance.onError/FlutterError.onError callbacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions