Global exception handling in a GUI class
Mostrar comentarios más antiguos
Hi,
I have a class that represents a GUI window and want to display any kind of exception that occurs in any class method as a errordlg (as console output ist not useful when using a gui).
- Is there a convenient way to redirect all exception-message-strings to the function errordlg()?
- This should especially include all errors that occur within any class method (like a call to obj.methodXY())
- It is desireable to catch also other errors (like wrong use of obj(..))
I have already tried overloading B=subsref(A,S), but this causes vast problems when methods with/without input-/output-arguments are called.
1 comentario
Daniel Shub
el 17 de Sept. de 2013
Have you tried overloading error?
Respuestas (1)
Sean de Wolski
el 17 de Sept. de 2013
Editada: Sean de Wolski
el 17 de Sept. de 2013
0 votos
I don't think there is a way to redirect from standard error to error dialog. You'll have to catch the MException and then throw the error dialog from there. This could be packaged as a function to make it reusable.
2 comentarios
Gregor
el 17 de Sept. de 2013
Sean de Wolski
el 17 de Sept. de 2013
I guess I don't understand how subsref would be called from a user using the figure/GUI/app.
Wouldn't whatever the user is doing be safeguarded against at that level? How are they going to use subsref?
Categorías
Más información sobre Customize Object Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!