[BUG] TileLayer.fallbackUrl
not attempted when FMNIP fails to decode a non-image
#1667
Labels
TileLayer.fallbackUrl
not attempted when FMNIP fails to decode a non-image
#1667
What is the bug?
The
decode
method called insideFlutterMapNetworkImageProvider._loadAsync
has a try-catch block around it to attempt to catch some errors and use the fallback URL.However, errors within the
decode
method itself are asynchronous and are not caught by this block.This means that an error when decoding, such as when decoding a non-image (eg. an error or login page) even with a 200 OK response (which is technically a server misconfiguration, but we should be as flexible as possible), does not trigger the usage of fallback URL.
How can we reproduce it?
Set the
urlTemplate
to any HTML page, such as 'https://google.com'. Set thefallbackUrl
to a real tile server serving known images. Errors are thrown and the fallback URL is not attempted.Do you have a potential solution?
See commit c2ac7bc in #1662.
Platforms
All
Severity
Erroneous: Prevents normal functioning and causes errors in the console
The text was updated successfully, but these errors were encountered: