diff --git a/src/node_map.cpp b/src/node_map.cpp index 89ba8d3b9..9a21decd5 100644 --- a/src/node_map.cpp +++ b/src/node_map.cpp @@ -229,13 +229,22 @@ void NodeMap::renderFinished() { assert(!image); if (error) { + std::string errorMessage; + + try { + std::rethrow_exception(error); + } catch (const std::exception& ex) { + errorMessage = ex.what(); + } + + v8::Local argv[] = { + NanError(errorMessage.c_str()) + }; + // This must be empty to be prepared for the next render call. error = nullptr; assert(!error); - v8::Local argv[] = { - NanError("Error rendering image") - }; cb->Call(1, argv); } else if (img) { auto result = NanNew();