Global exception handling in a GUI class
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Antworten (1)
Sean de Wolski
am 17 Sep. 2013
Bearbeitet: Sean de Wolski
am 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 Kommentare
Sean de Wolski
am 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?
Siehe auch
Kategorien
Mehr zu Customize Object Indexing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!