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

Better handling of exceptions #12

Open
pdesaulniers opened this issue Dec 17, 2018 · 6 comments
Open

Better handling of exceptions #12

pdesaulniers opened this issue Dec 17, 2018 · 6 comments

Comments

@pdesaulniers
Copy link
Member

pdesaulniers commented Dec 17, 2018

Right now, the UI crashes on MRuby exceptions. It would be very nice if these were caught somehow.

@fundamental
Copy link
Member

fundamental commented Dec 18, 2018 via email

@pdesaulniers
Copy link
Member Author

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.

@fundamental
Copy link
Member

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.

@pdesaulniers
Copy link
Member Author

pdesaulniers commented Dec 19, 2018

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 :)

@pdesaulniers
Copy link
Member Author

pdesaulniers commented Mar 14, 2019

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:

2019-03-14-19:00:33

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.

@fundamental
Copy link
Member

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).

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

No branches or pull requests

2 participants