Better error messages
Use the error message passed by the error exception instead of always reporting "Error rendering image".
This commit is contained in:
committed by
Mike Morris
parent
27fc2f18e3
commit
d434746a46
@@ -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<v8::Value> argv[] = {
|
||||
NanError(errorMessage.c_str())
|
||||
};
|
||||
|
||||
// This must be empty to be prepared for the next render call.
|
||||
error = nullptr;
|
||||
assert(!error);
|
||||
|
||||
v8::Local<v8::Value> argv[] = {
|
||||
NanError("Error rendering image")
|
||||
};
|
||||
cb->Call(1, argv);
|
||||
} else if (img) {
|
||||
auto result = NanNew<v8::Object>();
|
||||
|
||||
Reference in New Issue
Block a user