| 556 | } |
| 557 | |
| 558 | static void report_error(lua_State *L, color_ostream *out = NULL, bool pop = false) |
| 559 | { |
| 560 | error_tostring(L, true); |
| 561 | |
| 562 | const char *msg = lua_tostring(L, -1); |
| 563 | assert(msg); |
| 564 | |
| 565 | if (out) |
| 566 | out->printerr("{}\n", msg); |
| 567 | else |
| 568 | dfhack_printerr(L, msg); |
| 569 | |
| 570 | lua_pop(L, pop?2:1); |
| 571 | } |
| 572 | |
| 573 | static bool convert_to_exception(lua_State *L, int slevel, lua_State *thread = NULL) |
| 574 | { |
no test coverage detected