-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Image.network throws uncaught exception when providing valid url without an image #81931
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagescustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagescustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.found in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary:
I don't know why I can't catch
Image.networkexceptions. If I giveImage.networkan invalid URL, the errorBuilder kicks in, that's good but if I give it a valid URL with 404 response or non-image data, errorBuilder() doesn't seem to do anything. The app pauses because of the uncaught exception.Details:
I made a new app with
flutter create bug, this is my main.dart:For the first test, I give it an invalid URL (AAABBBCCC)
This one works as expected. errorBuilder() is called and 'N/A' is printed on the screen.
Now a valid URL but with 404 response: (https://example.com/nothing)
For the last try, a valid URL with data but invalid image data: (https://google.com/)
As you can see the app is pausing due to uncaught exceptions.
I've also tried
FadeInImage()andCachedNetworkImage(), they both act the same asImage.network().