Index: src/JsError.cpp |
=================================================================== |
--- 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)) |