Capture error information
Any MATLAB® code that detects an error and throws an exception must construct an
MException
object. This class 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 |