Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404
E/flutter (18499): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404
E/flutter (18499): #0 BaseCacheManager.getFile
package:flutter_cache_manager/src/cache_manager.dart:120
E/flutter (18499):
I have the same error. It only throws this error when I tried to load an image from a url whose response is 404. Is there some way to Catch this exception so that it will not throw an error on the console?
In debug mode it seems to freeze the app.
The same problem. It's very strange to throw exceptions when image is not available without ability to catch it. Why just not add callback if any error?
Emmm. I met the same error which response was 531
I have the same problem when call to a url return 404.
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404
I've set up with this
errorWidget: (context, url, error) => Icon(Icons.error),
but still, the app crashed when the image is 404.
so what's the point of errorWidget option?
The error comes from visual code debugger (or somewhere around), if you use flutter run from console then all works as it should. It happened to me with my own code and I posted an issue. https://github.com/flutter/flutter/issues/33427
@cosinus84 I tried running it using flutter run in the console and it still threw this exception. In my code, it's a large list of items with an image for each item. The weird thing is that when they get loaded for the first time no exceptions are thrown, it normally displays the error widget as it should. However, if I start scrolling the list, the exceptions start getting thrown for images with 404 response. I'm not sure what's causing that, but I'll take a look as soon as I'm done with my finals.
~~#144~~ #190 might fix this. @basselch, can you test it?
cached_network_image:
git:
url: git://github.com/rmarau/flutter_cached_network_image.git
ref: fix-getFile_multiplecalls
@rmarau I tested it on my app and your fix works. No exceptions are thrown while scrolling
I have the same problem. Any solution for that?
Fixed in 1.1.0
@renefloor I upgrade to 1.1.0, But got a new error.
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: type 'HttpException' is not a subtype of type 'FileInfo'
#0 BaseCacheManager.getFile (package:flutter_cache_manager/src/cache_manager.dart:120:11)
<asynchronous suspension>
#1 CachedNetworkImageState._animatedWidget (package:cached_network_image/src/cached_image_widget.dart:270:12)
#2 CachedNetworkImageState.build (package:cached_network_image/src/cached_image_widget.dart:196:12)
#3 StatefulElement.build (package:flutter/src/widgets/framework.dart:4012:27)
#4 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3924:15)
#5 Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)
#6 StatefulElement.update (package:flutter/src/widgets/framework.dart:4085:5)
#7 Element.updateChild (package:flutter/src/widgets/framework.dart:2876:15)
#8 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3935:16)
#9 Element.rebuild (package:flutter/src/widgets/<…>
I'm using version 1.1.0 and I still get the console error dump when I recieve a 403 status code when providing an errorWidget.
@renefloor same error.
We are also getting this error, but for 403
I think we're running into https://github.com/flutter/flutter/issues/33427 which seems to be related to a VM problem.
@renefloor
Same question
Same question
我还以为作者回复我了呢。。