Skip to content

Commit ba70a15

Browse files
committed
Updated sample
1 parent edad40e commit ba70a15

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

example/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
</script>
3535

3636
<button onclick="throwDivisionByZero()">Division By Zero</button>
37-
<button onclick="throwIndexOutOfRange()">Index Out Of Range</button>
37+
<button onclick="throwIndexOutOfRange(100)">Index Out Of Range</button>
38+
<button onclick="throwIndexOutOfRange(100, true)">Index Out Of Range with custom stacking</button>
3839
<button onclick="throwStringError()">Throw String Message</button>
3940
<button onclick="sendEvents(10)">Send 10 random events</button>
4041
<button onclick="sendEvents(100)">Send 100 random events</button>

example/index.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,23 @@ function throwStringError() {
2929
return throwStringErrorImpl('string error message');
3030
}
3131

32-
function throwIndexOutOfRange(indexer) {
32+
function throwIndexOutOfRange(indexer, withCustomStacking) {
3333
try {
3434
getNonexistentData(indexer);
3535
} catch (e) {
36-
exceptionless.ExceptionlessClient.default.submitException(e);
36+
var client = exceptionless.ExceptionlessClient.default;
37+
if (withCustomStacking) {
38+
if (Math.random() < .5) {
39+
client.createException(e).setManualStackingKey('MyCustomStackingKey').submit();
40+
} else {
41+
client.createException(e).setManualStackingInfo({
42+
File: 'index.js',
43+
Function: 'throwIndexOutOfRange'
44+
}, 'Custom Index Out Of Range Exception').submit();
45+
}
46+
} else {
47+
client.submitException(e);
48+
}
3749
}
3850
}
3951

0 commit comments

Comments
 (0)