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

[Bug] An exception during Tile3DLayer loading doesn't trigger DeckGL onError callback. #8755

Open
igorDykhta opened this issue Apr 4, 2024 · 3 comments
Labels

Comments

@igorDykhta
Copy link
Collaborator

igorDykhta commented Apr 4, 2024

Description

An exception during Tile3DLayer loading doesn't trigger DeckGL onError callback.
callback is ignored.
An error appears in the console.

Expected Behavior

It is expected for an error/exception in Deck.gl to be caught and onError callback to be called.

Steps to Reproduce

https://codepen.io/Igor-Dykhta/pen/gOyvbYM

Environment

  • Framework version: 8.9.27

Logs

The stack for the error in our app:

constructor (tileset-3d.ts:291)
_loadTileset (tile-3d-layer.ts:204)
await in _loadTileset (async)
updateState (tile-3d-layer.ts:119)
_update (layer.ts:944)
_initialize (layer.ts:886)
_initializeLayer (layer-manager.ts:339)
_updateSublayersRecursively (layer-manager.ts:303)
_updateLayers (layer-manager.ts:258)
setLayers (layer-manager.ts:206)
updateLayers2 (layer-manager.ts:218)
_onRenderFrame (deck.ts:1032)
onRender (animation-loop.js:269)
@igorDykhta igorDykhta added the bug label Apr 4, 2024
@ibgreen
Copy link
Collaborator

ibgreen commented Apr 4, 2024

Interesting questions.

To do this, it seems to me that deck would have to wrap all calls to any external code (such as loaders.gl) in try-catch statements.

I think we may want to discuss the purpose / definition of onError() callbacks:

  • Is it mostly for reporting WebGL context failures / layer manager errors?
  • Or are we intercepting all exceptions and converting them to callbacks, effectively changing the error reporting model?

@igorDykhta
Copy link
Collaborator Author

I know that ScatterplotLayer is definitely calling onError() callback when input data is wrong.
Maybe the problem with Tile3DLayer is that data processing is async.

@Pessimistress
Copy link
Collaborator

All lifecycle methods are wrapped in try/catch and will fire onError if they throw synchronously. The layer manager would not know if a layer starts a floating promise, which is the case here. Tile3DLayer is responsible of catching any error here.

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

No branches or pull requests

3 participants