Lua: Don't lua_error() out of context with pending dtors
[lsnes.git] / src / library / mathexpr-error.cpp
blob807fad103a94a703ff3f9836f8031ef5be83f246
1 #include "mathexpr-error.hpp"
3 namespace mathexpr
5 error::error(errorcode _code, const std::string& message)
6 : std::runtime_error(message), code(_code)
10 error::errorcode error::get_code()
12 return code;
15 const char* error::get_short_error()
17 switch(code) {
18 case UNDEFINED: return "#Undefined";
19 case CIRCULAR: return "#Circular";
20 case TYPE_MISMATCH: return "#Type";
21 case INTERNAL: return "#Internal";
22 case WDOMAIN: return "#Domain";
23 case DIV_BY_0: return "#Div-by-0";
24 case LOG_BY_0: return "#Log-of-0";
25 case ARGCOUNT: return "#Argcount";
26 case SIZE: return "#Badsize";
27 case ADDR: return "#Badaddr";
28 case FORMAT: return "#Badformat";
29 case UNKNOWN: return "#???";
30 default: return "#Unknownerr";