MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getExceptionAndClear

Method getExceptionAndClear

valdi/src/valdi/runtime/JavaScript/JavaScriptTypes.cpp:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44JSValueRef JSExceptionTracker::getExceptionAndClear() {
45 assertNotEmpty();
46
47 auto error = std::move(_error);
48 auto exception = std::move(_exception);
49 setEmpty(true);
50
51 if (error) {
52 exception = convertValdiErrorToJSError(_jsContext, error.value(), *this);
53 if (!*this) {
54 clearError();
55 }
56 }
57
58 return exception;
59}
60
61void JSExceptionTracker::onClearError() {
62 setEmpty(true);

Callers 7

TESTFunction · 0.80
onJsCallErrorFunction · 0.80
onJsCallErrorFunction · 0.80
InvokeCallableFunction · 0.80
handleUncaughtJsErrorMethod · 0.80
doFullfillMethod · 0.80
onJsCallErrorFunction · 0.80

Calls 2

valueMethod · 0.65

Tested by 1

TESTFunction · 0.64