This commit is contained in:
blueloveTH 2023-05-26 15:48:06 +08:00
parent d8afb8d7cf
commit f4e3bc2308
2 changed files with 8 additions and 3 deletions

View File

@ -15,6 +15,11 @@ using namespace pkpy;
vm->c_data->push(py_var(vm, e)); \ vm->c_data->push(py_var(vm, e)); \
vm->c_data->push(NULL); \ vm->c_data->push(NULL); \
return false; \ return false; \
} catch(const std::exception& re){ \
auto e = Exception("std::exception", re.what()); \
vm->c_data->push(py_var(vm, e)); \
vm->c_data->push(NULL); \
return false; \
} }

View File

@ -220,9 +220,9 @@ public:
} }
#if !DEBUG_FULL_EXCEPTION #if !DEBUG_FULL_EXCEPTION
catch (const std::exception& e) { catch (const std::exception& e) {
_stderr(this, "An std::exception occurred! It could be a bug.\n"); Str msg = "An std::exception occurred! It could be a bug.\n";
_stderr(this, e.what()); msg = msg + e.what();
_stderr(this, "\n"); _stderr(this, msg + "\n");
} }
#endif #endif
callstack.clear(); callstack.clear();