-
Notifications
You must be signed in to change notification settings - Fork 10
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
Better handling of exceptions #12
Comments
On 12-16, Patrick Desaulniers wrote:
Right now, the UI crashes on exceptions. It would be very nice if these were caught somehow.
I'm guessing you're referring to changing code during hotloading causing
issues.
If so, there's some logic to prevent loading completely non-functional
code, but getting something in place to roll back to an earlier commit
is rather complex, so that's not implemented.
Were you talking about that use-case or exceptions more generally?
|
I guess catching MRuby exceptions would be useful in both hotloading and regular use, since crashing is bad :) Basically, if a function causes an exception, I guess it could just return instead of crashing the UI. |
I'd say it depends on the case as crashing makes it easier to find the source of the issue. My personal error handling strategy tends to be "fail big and fail early" as it gets you the most accurate backtrace without extra factors which hide bugs. |
In some cases, plugin hosts will crash when a plugin UI crashes. This means that the users might lose some parts of their project. So, in release builds, I guess it would be reasonable to catch errors, and to display them in a modal window along with "please report this to the Zyn devs". I think this would actually be better than displaying the errors through stderr, because the user would be more likely to see them. In development, catching the errors would also be good to keep the flow going, though perhaps they should be handled differently. Note that I don't know how feasible this is, I'm just brainstorming :) |
As an example, I'm currently using https://github.com/rxi/lurker for a project of mine, and I think it handles errors really well. Instead of crashing, it shows a screen like this one: This would handle the "crash on hotreload" case. I guess something similar could be used for release builds too, along with a "ctrl+c to copy error" feature and a restart button. |
That sort of crash view would certainly be doable in some error states. Dumping to stderr is still the safest route when catastrophic errors happen and easier to use the system clipboard (IIRC PUGL does not support any clipboard). |
Right now, the UI crashes on MRuby exceptions. It would be very nice if these were caught somehow.
The text was updated successfully, but these errors were encountered: