fix(deck.gl-geotiff): raise COG open failures through onError - #652
Merged
kylebarron merged 3 commits intoSep 21, 2026
Merged
Conversation
COGLayer and MultiCOGLayer open their GeoTIFFs from updateState without awaiting the promise, so a header fetch or CRS resolution that fails rejects with nothing attached: the browser logs an unhandled rejection, onError never fires and the layer stays empty. Both opens now route a rejection through Layer.raiseError, which calls props.onError and falls back to the Deck-level handler, the path deck.gl uses for a failed async data load. Closes developmentseed#205 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
earlybard
marked this pull request as ready for review
September 17, 2026 08:39
Member
|
Thanks @earlybard. Can I ask how you're using deck.gl-raster? |
Contributor
Author
|
Hey @kylebarron. I'm building a COG viewer for open Geoscience Australia data. I'm:
There are some tricky mosaic-like issues I'll be tackling next, e.g. controlling z-index of scenes within the mosaic, and not rendering fully occluded scenes. Thanks again! |
kylebarron
reviewed
Sep 18, 2026
| this.clearState(); | ||
| this._parseGeoTIFF(); | ||
| this._parseGeoTIFF().catch((error: Error) => | ||
| this.raiseError(error, "loading GeoTIFF"), |
Member
There was a problem hiding this comment.
Oh interesting is raiseError an upstream method in the base deck.gl Layer?
Contributor
Author
There was a problem hiding this comment.
Yep it is. Marked (Internal) in the docstring but the types are public. Not sure how you feel about that!
My use case is a display in my UI if a GeoTIFF fails to load.
The alternative is a new prop like onGeoTIFFError, but this seemed easier + hooks into Deck's error handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I am changing
COGLayerandMultiCOGLayerkick off the GeoTIFF open fromupdateStateand never look at the promise again. If the header fetch or CRS lookup fails you get an unhandled rejection in the console,onErrorstays silent, and the layer just sits there empty.Both now catch that and hand it to
Layer.raiseError, soprops.onErrorfires, and Deck'sonErrorafter it unless you returntrue.How you can test it
On
main: unhandled rejection, no callback. With this: oneloading COG sources: …call. There's a unit test per layer too, and both fail onmain.Related Issues
Closes #205. Takes over from #206, which did the same for
COGLayeronly and has drifted out of date.AI disclosure: written with Claude Code as a code assistant, reviewed by me.