Run this check to check if all
try blocks are
only used for exception handling. Although not recommended,
try statements could also be used to suppress
errors or to express a simple condition. checkTryExceptionHandling
checks the following for every try:
Is there a
catchblock with at least one line of executable code?
Is an exception object assigned or created in the
ME = MException(errorID, msg);
Is at least one of the list of exception handling MATLAB-installed functions or keywords used in the
This does not check if points 2 and 3 hold for all execution paths
catch, so if you use an
else within the
catch and only call an exception handling
function in one of the two, it is not reported by this check.
RequireExceptionObject (boolean): When set to
true(default), perform check 2. When set to
false, do not require an exception object to be assigned or created in the
ExceptionHandlingFunctions (list): List of functions or MATLAB keywords (
returnetc.), at least one of which must be called within every
catch. The default list is
throwAsCaller. Other suggestions are:
returnor some user-defined exception handling function.