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

Add more cases of calling error callbacks #16150

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

ryantrem
Copy link
Member

@ryantrem ryantrem commented Feb 6, 2025

Several of the previously synchronous functions somewhat recently became asynchronous. However, this left us in a state where thrown errors end up in ignored Promises, and so you just see an unhandled error in the console log, rather than the error propagating to the caller through a final Promise and/or onError callback. This change tries to catch those missed cases and route them correctly, but at this point the code is very hard to reason about and understand where additional error handling is needed. Since there is no synchronous path anymore, we should rewrite a lot of this code to just use async/await, and have the callback based functions just be wrappers that still exist for back compat. This would make it way easier to understand and maintain the code. That said, this should probably be a post-8.0 release change.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@ryantrem ryantrem marked this pull request as ready for review February 6, 2025 03:35
@ryantrem ryantrem requested a review from deltakosh February 6, 2025 03:35
Copy link
Contributor

@deltakosh deltakosh left a comment

Choose a reason for hiding this comment

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

same comments as raanan

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 6, 2025

@ryantrem ryantrem merged commit 00abfc4 into BabylonJS:master Feb 6, 2025
15 checks passed
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 this pull request may close these issues.

5 participants