Baseflow / Baseflow/flutter_cached_network_image

FormatException: Unexpected end of input (at character 1)^

Open
#657 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

```
FormatException: Unexpected end of input (at character 1)^; #0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405)#1 _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:523)#2 _parseJson (dart:convert-patch/convert_patch.dart:41)#3 JsonDecoder.convert (dart:convert/json.dart:506)#4 JsonCodec.decode (dart:convert/json.dart:157)#5 jsonDecode (dart:convert/json.dart:96)#6 JsonCacheInfoRepository._readFile (package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart:144)#7 JsonCacheInfoRepository.open (package:flutter_cache_manager/src/storage/cache_info_repositories/json_cache_info_repository.dart:41)#8 CacheStore._getCacheDataFromDatabase (package:flutter_cache_manager/src/cache_store.dart:110)
```

As i've just mentioned here: https://github.com/Baseflow/flutter_cached_network_image/issues/656, i'll be good to wrap all file/json operations into try catch to avoid creating unhandled errors. Unfortunately, i can not reproduce this issue but it happens with users of my application.

By the way i use errorWidget for all CachedNetworkImages
![image](https://user-images.githubusercontent.com/63228361/135405121-cc6b4436-7997-4878-bef2-dc703b3895c6.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.