Repository: flutter
Issue: Image.network throws uncaught exception when providing valid url without an image 
Labels: framework,customer: crowd,a: images,a: error message,has reproducible steps,P2,found in release: 3.7,found in release: 3.11,team-framework,triaged-framework

**Summary:**
I don't know why I can't catch `Image.network` exceptions. If I give `Image.network` an 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.
```dart
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Network Image',
            ),
            MyImage(),
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

class MyImage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    try {
      return Image.network(
        'AAABBBCCC', //url,
        errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
          return Text('N/A');
        },
      );
    } catch (e) {
      print(e.toString());
    }

    return Container();
  }
}

```

![photo_2021-05-06_00-03-04](https://user-images.githubusercontent.com/17809451/117205533-01045f80-ae07-11eb-8e39-e5beb285ff7d.jpg)


Now a valid URL but with 404 response: (https://example.com/nothing)
```dart
class MyImage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    try {
      return Image.network(
        'https://example.com/nothing', //url,
        errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
          return Text('N/A');
        },
      );
    } catch (e) {
      print(e.toString());
    }

    return Container();
  }
}
```
![bug01](https://user-images.githubusercontent.com/17809451/117206062-a15a8400-ae07-11eb-9234-2e5e4140c5f1.jpg)

For the last try, a valid URL with data but invalid image data: (https://google.com/)
```dart
class MyImage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    try {
      return Image.network(
        'https://google.com/', //url,
        errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
          return Text('N/A');
        },
      );
    } catch (e) {
      print(e.toString());
    }

    return Container();
  }
}
```
![bug02](https://user-images.githubusercontent.com/17809451/117206525-38274080-ae08-11eb-9f43-672f3a787701.jpg)


As you can see the app is pausing due to uncaught exceptions.

I've also tried `FadeInImage()` and `CachedNetworkImage()`, they both act the same as `Image.network()`.

```
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 2.2.0-10.2.pre, on Microsoft Windows [Version 10.0.19041.928], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Android Studio
[√] Connected device (3 available)

• No issues found!
```