#Redirecting browser console errors to Rust?

5 messages · Page 1 of 1 (latest)

dire dawn
#

I'm trying to debug an issue that a customer is having on macOS 10.13 where the app starts with a white screen. I think it's probably something like some unsupported bit of JS. Once the webview is up and running I think Sentry will catch errors for me, but if it fails at parsing then all bets are off. Is there a way to tell Tauri (wry?) to forward browser errors to the Rust side, so I can log them somehow?

low glacier
dire dawn
#

oh sweet thanks, I didn't know about that plugin! that looks like just what I need

#

hm if my JS is failing very early, like during parsing, I'm not sure it'll catch those errors?

low glacier
#

I mean you can set up that it loads as the first thing that happens in your app. Depending on your frontend framework this might be really easy or a bit more difficult. It's essentially just a matter of e.g. adding a script tag earlier in your index.html file than any other scripts you use