forked from ff6347/debugging-ae-scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ErrorHandling.jsx
67 lines (47 loc) · 1.2 KB
/
ErrorHandling.jsx
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
//NOT WORKING
{
var errorHappend = false;
main();
$.onError = err;
if(!errorHappend){
alert("No Error");
};
function err(errString) {
alert(errString);
errorHappend = true;
}
function main () {
do {
var testObject = new Object();
testObject.myString = "Test";
testObject.myNumber = 2;
testObject.myBool = true;
testObject.myArray = [1,23,4,5,56,6,7];
testObject.myObject = {
myString : "Test",
myNumber : 2,
myBool : true,
myArray : [1,23,4,5,56,6,7]
};
testObject.myNumber.split("");
}
while ($.Error == false) ;
alert($.Error + "$.Error");
return;
};// end function main
}
//---------------------------------------------------------------
//http://forums.adobe.com/message/4193764
// var errorHappened = false;
// function err(errString) {
// alert(errString);
// errorHappened
// }
// app.onError = err;
// function doThis(){
// errorHappened = false; //reset
// doSomethingThatCanTriggerOnError();
// }
// doThis();
// if (!errorHappened) doThat();
//---------------------------------------------------------------