Global exception handling in a GUI class
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Réponses (1)
Sean de Wolski
le 17 Sep 2013
Modifié(e) : Sean de Wolski
le 17 Sep 2013
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 commentaires
Sean de Wolski
le 17 Sep 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?
Voir également
Catégories
En savoir plus sur Customize Object Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!