summaryrefslogtreecommitdiff
path: root/core/libdeno/exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'core/libdeno/exceptions.cc')
-rw-r--r--core/libdeno/exceptions.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/libdeno/exceptions.cc b/core/libdeno/exceptions.cc
index 7484e4eb4..5f4d578b6 100644
--- a/core/libdeno/exceptions.cc
+++ b/core/libdeno/exceptions.cc
@@ -200,6 +200,7 @@ void HandleException(v8::Local<v8::Context> context,
std::string json_str = EncodeExceptionAsJSON(context, exception);
CHECK_NOT_NULL(d);
d->last_exception_ = json_str;
+ d->last_exception_handle_.Reset(isolate, exception);
}
void HandleExceptionMessage(v8::Local<v8::Context> context,
@@ -218,6 +219,15 @@ void HandleExceptionMessage(v8::Local<v8::Context> context,
d->last_exception_ = json_str;
}
+void ClearException(v8::Local<v8::Context> context) {
+ v8::Isolate* isolate = context->GetIsolate();
+ DenoIsolate* d = DenoIsolate::FromIsolate(isolate);
+ CHECK_NOT_NULL(d);
+
+ d->last_exception_.clear();
+ d->last_exception_handle_.Reset();
+}
+
void ThrowInvalidArgument(v8::Isolate* isolate) {
isolate->ThrowException(v8::Exception::TypeError(v8_str("Invalid Argument")));
}