maix::err
maix.err module
This is
maix::err
module of MaixCDK.
All of these elements are in namespacemaix::err
.For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!
Module
No module
Enum
Err
Maix Error code
item | describe |
---|---|
values | ERR_NONE: No error ERR_ARGS: Invalid arguments ERR_NO_MEM: No memory ERR_NOT_IMPL: Not implemented ERR_NOT_READY: Not ready ERR_NOT_INIT: Not initialized ERR_NOT_OPEN: Not opened ERR_NOT_PERMIT: Not permitted ERR_REOPEN: Re-open ERR_BUSY: Busy ERR_READ: Read error ERR_WRITE: Write error ERR_TIMEOUT: Timeout ERR_RUNTIME: Runtime error ERR_IO: IO error ERR_NOT_FOUND: Not found ERR_ALREAY_EXIST: Already exist ERR_BUFF_FULL: Buffer full ERR_BUFF_EMPTY: Buffer empty ERR_CANCEL: Cancel ERR_OVERFLOW: Overflow ERR_MAX: |
C++ defination code:
enum Err { // !!! fixed error code, DO NOT change number already defined, only append new error code ERR_NONE = 0, // No error ERR_ARGS , // Invalid arguments ERR_NO_MEM , // No memory ERR_NOT_IMPL , // Not implemented ERR_NOT_READY , // Not ready ERR_NOT_INIT , // Not initialized ERR_NOT_OPEN , // Not opened ERR_NOT_PERMIT , // Not permitted ERR_REOPEN , // Re-open ERR_BUSY , // Busy ERR_READ , // Read error ERR_WRITE , // Write error ERR_TIMEOUT , // Timeout ERR_RUNTIME , // Runtime error ERR_IO , // IO error ERR_NOT_FOUND , // Not found ERR_ALREAY_EXIST , // Already exist ERR_BUFF_FULL , // Buffer full ERR_BUFF_EMPTY , // Buffer empty ERR_CANCEL , // Cancel ERR_OVERFLOW , // Overflow ERR_MAX, }
Variable
Function
to_str
Error code to string
item | description |
---|---|
param | e: direction [in], error code, err::Err type |
return | error string |
C++ defination code:
std::string to_str(err::Err e)
get_error
get last error string
item | description |
---|---|
return | error string |
C++ defination code:
std::string& get_error()
set_error
set last error string
item | description |
---|---|
param | str: direction [in], error string |
C++ defination code:
void set_error(const std::string &str)
check_raise
Check error code, if not ERR_NONE, raise err.Exception
item | description |
---|---|
param | e: direction [in], error code, err::Err type msg: direction [in], error message |
C++ defination code:
void check_raise(err::Err e, const std::string &msg = "")
check_bool_raise
Check condition, if false, raise err.Exception
item | description |
---|---|
param | ok: direction [in], condition, if true, do nothing, if false, raise err.Exception msg: direction [in], error message |
C++ defination code:
void check_bool_raise(bool ok, const std::string &msg = "")
check_null_raise
Check NULL pointer, if NULL, raise exception
item | description |
---|---|
param | ptr: direction [in], pointer msg: direction [in], error message |
C++ defination code:
void check_null_raise(void *ptr, const std::string &msg = "")
Class
Exception
Maix Exception
C++ defination code:
class Exception : public std::exception