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

expose Error Handling via onError prop? #17

Open
qm210 opened this issue Dec 27, 2020 · 0 comments
Open

expose Error Handling via onError prop? #17

qm210 opened this issue Dec 27, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@qm210
Copy link

qm210 commented Dec 27, 2020

Hi,
shadertoy-react is working really good actually, thanks. However, I wasn't able to find a way to programmatically handle the case that I pass it an erroneous shader? I have that case legitimately because my shader gets built by my react application, so at the moment I can't just guarantee that everything is going fine.
So I see lots of console warnings (and a black screen in shadertoy-react), but would it be an unreasonable effort to make available to catch these errors beforehand?

I'm thinking of a quite unsophisticated prop like onError={err => {/* do stuff with error code, message, whatever */} for the ShadertoyReact component.

I've tried wrapping the thing in try/catch blocks or using react-error-boundary, but they won't fail - as ShadertoyReact doesn't actually fail due to its internal error handling

in any case, great work you did with this library. I totally prefer working with it over the original shadertoy, as it is way smoother.

best,
qm

@mvilledieu mvilledieu added the enhancement New feature or request label Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants