-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathV8Exception.h
More file actions
53 lines (44 loc) · 1.46 KB
/
V8Exception.h
File metadata and controls
53 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
//-----------------------------------------------------------------------------
// V8Exception
//-----------------------------------------------------------------------------
class V8Exception final
{
public:
enum class Type
{
General,
Interrupt,
Fatal
};
V8Exception(Type type, const StdString& engineName, StdString&& message, bool executionStarted):
m_Type(type),
m_EngineName(engineName),
m_Message(std::move(message)),
m_ExecutionStarted(executionStarted),
m_ScriptException(V8Value::Null),
m_InnerException(V8Value::Undefined)
{
}
V8Exception(Type type, const StdString& engineName, StdString&& message, StdString&& stackTrace, bool executionStarted, V8Value&& scriptException, V8Value&& innerException):
m_Type(type),
m_EngineName(engineName),
m_Message(std::move(message)),
m_StackTrace(std::move(stackTrace)),
m_ExecutionStarted(executionStarted),
m_ScriptException(std::move(scriptException)),
m_InnerException(std::move(innerException))
{
}
void ScheduleScriptEngineException() const noexcept;
private:
Type m_Type;
StdString m_EngineName;
StdString m_Message;
StdString m_StackTrace;
bool m_ExecutionStarted;
V8Value m_ScriptException;
V8Value m_InnerException;
};