Package: matlab.exception
Capture error information for Java exception
Process information from a matlab.exception.JavaException
object
to handle Java® errors thrown by Java methods called from MATLAB®.
This class is derived from MException
.
constructs
instance e
= matlab.exception.JavaException(msgID
,errMsg
,excObj
)e
of matlab.exception.JavaException
class.
You do not typically construct a matlab.exception.JavaException
object explicitly. MATLAB automatically constructs a JavaException
object
whenever Java throws an exception. The JavaException
object wraps the
original Java exception.
|
Message identifier |
|
Error message text |
|
|
|
Instance of |
|
Java exception object that caused the error |
Handle. To learn how handle classes affect copy operations, see Copying Objects.
To display error information, use a matlab.exception.JavaException
object
in a try-catch
statement.
try java.lang.Class.forName('myfunction'); catch e e.message if(isa(e,'matlab.exception.JavaException')) ex = e.ExceptionObject; assert(isJava(ex)); ex.printStackTrace; end end