From 4b0dc3b5a5c7d764a540bd01aebe9bfb94065f79 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Wed, 7 Feb 2024 23:23:00 +0100 Subject: [PATCH] show the error when failing to init --- src/main.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 9740d8c..4a415b7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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();