Index: src/JsError.cpp |
=================================================================== |
--- a/src/JsError.cpp |
+++ b/src/JsError.cpp |
@@ -39,8 +39,23 @@ |
auto lineNumber = message->GetLineNumber(isolate->GetCurrentContext()); |
if (lineNumber.IsJust()) |
error << lineNumber.FromJust(); |
else |
error << "<unknown>"; |
} |
return error.str(); |
} |
+ |
+JsValueError::JsValueError(v8::Isolate* isolate, const char* filename, int line) |
+ : std::runtime_error(ErrorToString(filename, line)) |
+{ |
+} |
+ |
+std::string JsValueError::ErrorToString(const char* filename, int line) |
+{ |
+ std::stringstream error; |
+ error << "Empty value at "; |
+ error << filename; |
+ error << ":"; |
+ error << line; |
+ return error.str(); |
+} |