Is there a way to catch native exceptions so that the application won't crash ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to catch native exceptions so that the application won't crash ?

mohamed.abdelhameed
i had a crash before when a GLJPanel got painted while a buffer named (which should have been cleared) was still there and got used for rendering ,
i fixed that issue , but the question is , is there a way to just catch the exception and log it and avoid crashing ?
log file of the crash
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to catch native exceptions so that the application won't crash ?

gouessej
Administrator
Hello

You obtain an EXCEPTION_ACCESS_VIOLATION, it can happen when there is something wrong in the position of your buffer that makes JOGL try to read too far beyond the limit. It's probably not a bug in JOGL itself, the problem is rather in your own source code.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to catch native exceptions so that the application won't crash ?

Mohamed Abdelhameed
Thanks for replying ,
ok , that's true for that case , but i mentioned it just as an example ,
what i was asking about is that if there's a general way to catch exceptions thrown by openGL or jogl to prevent java application from crashing ,
suppose an end user was trying the application and due to some problem with GPU driver or a bug in the software an exception is thrown ,
should that exception crash the application without at least displaying error message to the user and give him a chance to save progress or send a log file to the developers for investigation ?
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to catch native exceptions so that the application won't crash ?

gouessej
Administrator
GLException is a kind of unchecked exception derived from RuntimeException, some methods can throw those exceptions without having to declare "throws GLException". You can catch the exceptions in your GLEventListener, can't you?
Julien Gouesse | Personal blog | Website