forked from cefsharp/CefSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptionTest.html
More file actions
74 lines (73 loc) · 2.37 KB
/
ExceptionTest.html
File metadata and controls
74 lines (73 loc) · 2.37 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Exception Test</title>
<script type="text/javascript">
function logException(e)
{
document.write(e.message.replace(/\n/g, '<br />') + "<br />Stack:<br />" + e.stack.replace(/\n/g, '<br />'));
}
</script>
</head>
<body>
<p>
Exception string for nested exceptions:<br />
<script type="text/javascript">
try
{
bound.exceptionTestObject.triggerNestedExceptions();
document.write("Fatal: No Exception.");
}
catch (e)
{
logException(e);
}
</script>
</p>
<p>
Exception string for wrong parameter type:<br />
<script type="text/javascript">
try
{
bound.exceptionTestObject.triggerParameterException(Math.PI);
document.write("Fatal: No Exception.");
}
catch (e)
{
logException(e);
}
</script>
</p>
<p>
Exception string for missing parameter:<br />
<script type="text/javascript">
try
{
bound.exceptionTestObject.triggerParameterException();
document.write("Fatal: No Exception.");
}
catch (e)
{
logException(e);
}
</script>
</p>
<p>
Exception string for error callback:<br />
<script type="text/javascript">
function errorCallback(s)
{
throw "Callback Error (" + s + ")";
}
function errorCallbackResultLogger(s)
{
var logArea = document.getElementById('errorCallbackResult');
logArea.innerText = s;
}
bound.exceptionTestObject.testCallbackException(errorCallback, errorCallbackResultLogger);
</script>
<p>Received Exception:</p>
<p id="errorCallbackResult"></p>
</p>
</body>
</html>