mwException
Exception type used by the mwArray
API
and the C++ interface functions
Description
The mwException
class is the basic exception
type used by the mwArray
API and the C++ interface
functions. All errors created during calls to the mwArray
API
and to generated C++ interface functions are thrown as mwExceptions
.
Required Headers
mclcppclass.h
mclmcrrt.h
Tip
MATLAB® Compiler SDK™ automatically includes these header files in the header file generated for your MATLAB functions.
Constructors
mwException()
Construct new mwException
with default error
message.
mwException(char* msg)
Create an mwException
with a specified error
message.
char* msg | Null terminated character buffer to use as the error message |
mwException(mwException& e)
Create a copy of an mwException
.
mwException& e | Initialized mwException instance to copy |
mwException(std::exception& e)
Create new mwException
from existing std::exception
.
std::exception& e | std::exception to copy |
Methods
char* what() const throw()
Return the error message contained in this exception.
try { ... } catch (const std::exception& e) { std::cout << e.what() << std::endl; }
void print_stack_trace()
Print the stack trace to std::cerr
.
Operators
mwException& operator=(const mwException& e)
Copy the contents of one exception into a new exception.
mwException& e | An initialized mwException instance to copy |
try { ... } catch (const mwException& e) { mwException e2 = e; throw e2; }
mwException& operator=(const std::exception& e)
Copy the contents of one exception into a new exception.
std::exception& e | std::exception to copy |
try { ... } catch (const std::exception& e) { mwException e2 = e; throw e2; }
Version History
Introduced in R2013b