Syntax
异常= MException.last
MException.last('reset')
Description
returns the contents of the most recently thrown, uncaught异常
= MException.lastMException
object.MException.last
is not set if the last exception is caught by atry/catch
statement.MException.last
is a static method of theMException
class.
MException.last('reset')
clears the properties of the exception returned fromMException.last
. It sets theMException
identifier
andmessage
properties to an empty character vector, the堆栈
property to a 0-by-1 structure, and thecause
property to an empty cell array.
Examples
Tips
Use
MException.last
only from the Command Window, not within a function.
See Also
assert
|error
|MException
|MException.addCause
|MException.getReport
|MException.rethrow
|MException.throw
|MException.throwAsCaller
|try, catch
Introduced in R2007b
Was this topic helpful?