Skip to content

Commit

Permalink
show the error when failing to init
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Feb 7, 2024
1 parent 0ddbc13 commit 4b0dc3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ static Napi::Object PympInit(Env env, Object exports) {
#endif
auto status = Py_InitializeFromConfig(&config);
PyConfig_Clear(&config);
if (PyStatus_Exception(status)) { throw Error::New(env, "Failed initializing Python"); }
if (PyStatus_Exception(status)) {
throw Error::New(env, "Failed initializing Python: "s + std::string{status.err_msg});
}
memview::Init();
PyObjectWrap::InitJSTrampoline();
py_main = PyEval_SaveThread();
Expand Down

0 comments on commit 4b0dc3b

Please sign in to comment.