Capture error information
Any MATLAB® code that detects an error and throws an exception constructs an
MException
object. The MException
object contains retrievable
information about errors. MATLAB can throw either predefined exceptions or exceptions that you
construct.
throw | Throw exception |
MException.last | Return last uncaught exception |
rethrow | Rethrow previously caught exception |
throwAsCaller | Throw exception as if occurs within calling function |
addCause | Record additional causes of exception |
addCorrection | Provide suggested fix for exception |
getReport | Get error message for exception |