#include <sysio/vm/utils.hpp>
#include <cstdint>
#include <exception>
Go to the source code of this file.
◆ DECLARE_EXCEPTION
#define DECLARE_EXCEPTION |
( |
| name, |
|
|
| _code, |
|
|
| _what ) |
Value:
name(std::string msg) : msg(msg) {} \
virtual const char*
what()
const throw() {
return _what; } \
virtual const char*
detail()
const throw() {
return msg.c_str(); } \
uint32_t code()
const {
return _code; } \
std::string msg; \
};
virtual const char * what() const =0
virtual const char * detail() const =0
Definition at line 20 of file exceptions.hpp.
20#define DECLARE_EXCEPTION(name, _code, _what) \
21 struct name : public sysio::vm::exception { \
22 name(std::string msg) : msg(msg) {} \
23 virtual const char* what()const throw() { return _what; } \
24 virtual const char* detail()const throw() { return msg.c_str(); } \
25 uint32_t code()const { return _code; } \
26 std::string msg; \
27 };
◆ SYS_VM_ASSERT
#define SYS_VM_ASSERT |
( |
| expr, |
|
|
| exc_type, |
|
|
| msg ) |
Value:
Definition at line 8 of file exceptions.hpp.
8#define SYS_VM_ASSERT( expr, exc_type, msg ) \
9 if (!UNLIKELY(expr)) { \
10 throw exc_type{msg}; \
11 }