[Try...Catch] Can I Disable Try... Catch?

[Try...Catch] Can I Disable Try... Catch?

Post by Michael Ro » Sat, 20 Aug 2005 23:02:34


I have many TRY ... CATCH statements in my code.

Can I tell MATLAB to ignore them, something like the way WARNING OFF
disables warnings?

The problem is that it is difficult to debug once the error is
caught. I like the TRY... CATCH feature for my production code but
it is bothersome for development.
 
 
 

[Try...Catch] Can I Disable Try... Catch?

Post by Steven Lor » Sun, 21 Aug 2005 00:19:49


No, you can't, without commenting them out somehow. However ...


You might want to try using DBSTOP IF CAUGHT ERROR or the equivalent option
in the Editor's debug menu. This will cause MATLAB to enter debug mode when
it encounters an error inside a TRY/CATCH block. You can even specify
message IDs so that MATLAB stops if, say, the error with message ID
'MATLAB:UndefinedFunction' gets thrown inside the TRY/CATCH block but
doesn't stop if 'MATLAB:scriptNotAFunction' is the error thrown.

DBSTOP documentation describing DBSTOP IF CAUGHT ERROR
http://www.yqcomputer.com/

Editor documentation for the equivalent functionality
http://www.yqcomputer.com/ #71986

--
Steve Lord
XXXX@XXXXX.COM

 
 
 

[Try...Catch] Can I Disable Try... Catch?

Post by Michael Ro » Sun, 21 Aug 2005 01:46:26

> You might want to try using DBSTOP IF CAUGHT ERROR or the

Excellent. Keep up the good work! You guys are really earning your
maintenance dollars!
 
 
 

[Try...Catch] Can I Disable Try... Catch?

Post by Michael Ro » Wed, 24 Aug 2005 05:41:59

>> You might want to try using DBSTOP IF CAUGHT ERROR or the
message

I wrote too soon.

That does what I want but not what I need.

When I use that suggestion, it stops at any TRY/CATCH, even the ones
I don't want it to stop at. For instance, it seems to always stop at
UIGETFILE, though I'm not sure why.

I guess what I really need is for it to ignore the TRY/CATCH blocks
in *my* code and to recognize them in the code that is in the MATLAB
root.