forked from Taritsyn/JavaScriptEngineSwitcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsScriptException.cs
More file actions
57 lines (51 loc) · 1.53 KB
/
JsScriptException.cs
File metadata and controls
57 lines (51 loc) · 1.53 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
54
55
56
57
namespace JavaScriptEngineSwitcher.ChakraCore.JsRt
{
using System;
/// <summary>
/// The script exception
/// </summary>
internal sealed class JsScriptException : JsException
{
/// <summary>
/// The error
/// </summary>
private readonly JsValue _error;
/// <summary>
/// Gets a JavaScript object representing the script error
/// </summary>
public JsValue Error
{
get
{
return _error;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="JsScriptException"/> class
/// </summary>
/// <param name="code">The error code returned</param>
/// <param name="error">The JavaScript error object</param>
public JsScriptException(JsErrorCode code, JsValue error)
: this(code, error, "JavaScript Exception")
{ }
/// <summary>
/// Initializes a new instance of the <see cref="JsScriptException"/> class
/// </summary>
/// <param name="code">The error code returned</param>
/// <param name="error">The JavaScript error object</param>
/// <param name="message">The error message</param>
public JsScriptException(JsErrorCode code, JsValue error, string message)
: base(code, message)
{
_error = error;
}
/// <summary>
/// Initializes a new instance of the <see cref="JsScriptException"/> class
/// </summary>
/// <param name="message">The error message</param>
/// <param name="innerException">The exception that is the cause of the current exception</param>
private JsScriptException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}