-
Notifications
You must be signed in to change notification settings - Fork 38
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
Prevent 'rolling' exception errors in the console #21
Comments
Or we could simply not catch exceptions in redraw and leave that to the user. This would just cause plask to quit which is generally what you'd want, right? |
I'm not sure if i want it to quit. What could be even better is to have error function along init, draw, so I can overwrite it if needed.. |
My preference would be for Plask to do as little as possible. If I don't want it to quit, I can just surround the code that might throw an exception with a try / catch and handle it there. But then, maybe I shouldn't be using SimpleWindow? |
In the last few projects I've been working on, I've had a debug command line flag, and if it's enabled then I do extra OpenGL checking and other sort of asserts. Was thinking maybe it makes sense to have a simpleWindow flag like debug, where it will catch exceptions in init() and not call draw(), or it will just abort on exception in general. Then of course you wouldn't run this for an actual installation, but at least while you're working it helps a lot with the rolling exception thing which is really always a problem for me, at least. |
I like the idea of debug flag causing application abort on exception. Would On Thu, Aug 7, 2014 at 2:45 PM, Dean McNamee notifications@github.com
Marcin Ignac |
I thought about that, but there are some problems wrapping the gl object, because now there are some APIs that expect the "real" gl object, not a wrapped one. The alternative for these APIs is like what I did for Syphon, which is the "factory" is on the gl function, so you call gl.createSyphonServer, instead of new SyphonServer(gl)... I guess a simpler thing you could do is just check for gl errors at the end of a frame, but then you don't know exactly which API cause it, so it's not that helpful... |
What's the difference? Are they messing up with gl member functions On Thu, Aug 7, 2014 at 8:05 PM, Dean McNamee notifications@github.com
Marcin Ignac |
The difference is that they are native APIs, and they need to get the real NSOpenGLContext pointer underneath the JavaScript object. |
Sure but instead of
can we do
and just use ctx (original gl) as usual? |
I guess, but my idea was sort of not to "destroy" the original object. |
I understand that as it's not a good practice. Maybe that should be another On Mon, Aug 11, 2014 at 1:03 PM, Dean McNamee notifications@github.com
Marcin Ignac |
Whenever i get exception in my draw function it is caught and displayed in the console. But because there is no more drawing code executed they are printed @ 30fps which is annoying and unreadable. Because it's already cought by Plask I can't catch using process.on('uncaughtException', ...). Can we have something like this in redraw() ?
var prevException = null;
...
if (prevException != '' + ex) {
prevException = '' + ex;
sys.error('Exception caught in simpleWindow draw:\n' + ex + '\n' + ex.stack);
}
The text was updated successfully, but these errors were encountered: