Global exception handling in a GUI class
古いコメントを表示
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 件のコメント
Daniel Shub
2013 年 9 月 17 日
Have you tried overloading error?
回答 (1 件)
Sean de Wolski
2013 年 9 月 17 日
編集済み: Sean de Wolski
2013 年 9 月 17 日
0 投票
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 件のコメント
Gregor
2013 年 9 月 17 日
Sean de Wolski
2013 年 9 月 17 日
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?
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!