title: Flutter integration_test: How to assert for `ImageCodecException` Exception in integration testing?
body: <p>I am developing flutter integration_tests for flutter web application. When i launch my main() app, the system throws an exception as &quot;ImageCodecException: Failed to decode image data&quot;.
  In above case i would expect the test to pass if an exception is thrown considering I expect an Exception. How do i assert for <code>ImageCodeException</code>?</p>
  <p>Tried:</p>
  <pre><code>testWidgets('Test for invalid file upload', (WidgetTester tester) async {
        app.main();
  
        FlutterError.onError = (FlutterErrorDetails data) {
          if (data.exception is FlutterError) {
            final fErr = data.exception as FlutterError;
            if (fErr.message == 'Failed to decode image data.') {
              return;
            }
          }
          FlutterError.presentError(data);
        };
      });
  </code></pre>
  <p>Exception:</p>
  <pre><code>══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞═════════════════
  The following ImageCodecException was thrown resolving an image
  codec:
  Failed to decode image data.
  Image source: encoded image bytes
  </code></pre>
  <p>I have overridden the <code>FlutterError.onError</code> which indeed bypasses the exception..How do i assert for specific <code>ImageCodecException</code> Exception?.</p>