Index: src/JsError.cpp |
diff --git a/src/JsError.cpp b/src/JsError.cpp |
index d8c6fd8156fee44fd45a66762e7f1fbb895bf06b..49a87c581fd82e45d58c20d0e11bb488bd653f69 100644 |
--- a/src/JsError.cpp |
+++ b/src/JsError.cpp |
@@ -17,6 +17,24 @@ |
#include "JsError.h" |
+namespace |
+{ |
+ std::string ExceptionToString(const v8::Handle<v8::Value>& exception, |
+ const v8::Handle<v8::Message>& message) |
+ { |
+ std::stringstream error; |
+ error << *v8::String::Utf8Value(exception); |
+ if (!message.IsEmpty()) |
+ { |
+ error << " at "; |
+ error << *v8::String::Utf8Value(message->GetScriptResourceName()); |
+ error << ":"; |
+ error << message->GetLineNumber(); |
+ } |
+ return error.str(); |
+ } |
+} |
+ |
AdblockPlus::JsError::JsError(const v8::Handle<v8::Value>& exception, |
const v8::Handle<v8::Message>& message) |
: std::runtime_error(ExceptionToString(exception, message)) |