Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handling tileProvider errors #536

Closed
X-SLAYER opened this issue Mar 4, 2020 · 7 comments · Fixed by #572
Closed

handling tileProvider errors #536

X-SLAYER opened this issue Mar 4, 2020 · 7 comments · Fixed by #572

Comments

@X-SLAYER
Copy link

X-SLAYER commented Mar 4, 2020

sometime tileProvider cause stopping of the app because of the remote server cant return a response or the cachingNetwork cant find a file but i didn't find a way to handle these errors to avoid the crash of the app

@ibrierley
Copy link
Collaborator

hmm it doesn't crash it on mine (I have a pull request that "may" help with that, not sure), but I suspect could be handled better...does it trigger a crash in release mode, and is it possible to include the code to replicate ? It may be worse on certain tileproviders.

@X-SLAYER
Copy link
Author

X-SLAYER commented Mar 6, 2020

hmm it doesn't crash it on mine (I have a pull request that "may" help with that, not sure), but I suspect could be handled better...does it trigger a crash in release mode, and is it possible to include the code to replicate ? It may be worse on certain tileproviders.

ididint try it on release mode , but in debug mode try to use NonCachingNetworkTileProvider and zoom in more and more until the server could not get an image and it will throw eception

@ibrierley
Copy link
Collaborator

In the interim, to get around that problem, maybe set a min/maxzoom, to prevent that problem. But naturally we don't want it to crash still, just handle it gracefully.

@X-SLAYER
Copy link
Author

X-SLAYER commented Mar 6, 2020

yes i already did but for cachingNetworkTile i cant handle that

@ibrierley
Copy link
Collaborator

It may be useful to post the output of the crash btw, just to see which bit is causing it, maybe that provider can wrap the request in a try clause or something.

@X-SLAYER
Copy link
Author

X-SLAYER commented Mar 6, 2020

════════ Exception caught by image resource service ════════════════════════════
The following _Exception was thrown resolving an image codec:
Exception: File was empty

When the exception was thrown, this was the stack
#0 CachedNetworkImageProvider._loadAsyncFromFile
package:cached_network_image/src/cached_network_image_provider.dart:75

Capture

@ghost
Copy link

ghost commented Mar 20, 2020

I have same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants