Skip to content

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Feb 7, 2020

Description

Analysis at #44579

Rather than throwing an assertion here, this should be a runtime error. This also makes it clearer why the load failed and properly uses the error handling mechanisms we have in place.

/cc @slightfoot @escamoteur

Related Issues

Fixes #44579

Tests

I added the following tests:

Tests that we throw a state error when trying to load an empty file.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@dnfield dnfield requested a review from jonahwilliams February 7, 2020 09:40
@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Feb 7, 2020
@dnfield dnfield added a: error message Error messages from the Flutter framework a: images Loading, displaying, rendering images labels Feb 7, 2020
@slightfoot
Copy link
Member

Thanks for addressing this @dnfield

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@fluttergithubbot fluttergithubbot merged commit 2627122 into flutter:master Feb 7, 2020
@dnfield dnfield deleted the file_image_empty branch February 7, 2020 20:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: error message Error messages from the Flutter framework a: images Loading, displaying, rendering images framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure of ImageProvider's error handling

5 participants