Errors Table

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

xbytor

Errors Table

Post by xbytor »

I posted this over at Adobe Forums as well.

I finally figured out a way to map error numbers to error strings. Note that this list does not contain errors (like 8800) for which there is no unique text. Errors like 8800 can have arbitrary text so doing a mapping for them would prove to be impractical for me to automate.

The primary driver for cooking up this table was the need to handle exceptions based on their number, not the text of the message, because English is not the only language out there .

Here is this list that I was able to come up with. The 'XXX' in some strings is replaced at runtime typically by a variable name.

2, ReferenceError, "XXX is undefined"
3, ReferenceError, "Cannot assign value"
4, SyntaxError, "Unterminated string constant"
5, SyntaxError, "Unterminated comment"
6, SyntaxError, "Bad digit in number"
7, SyntaxError, "Language feature 'XXX' is not supported"
8, SyntaxError, "Syntax error"
9, SyntaxError, "Illegal use of reserved word 'XXX'"
10, SyntaxError, "Illegal break or continue outside a loop"
11, SyntaxError, "Label not found"
12, SyntaxError, "Expression is not constant"
13, SyntaxError, "Too many closing braces"
14, SyntaxError, "No matching closing brace found"
15, SyntaxError, "Try without catch or finally"
16, SyntaxError, "catch/finally without try"
17, TypeError, "Variable name expected"
18, TypeError, "Variable or value expected"
19, TypeError, "Bad argument XXX"
20, TypeError, "Bad argument list"
21, TypeError, "XXX is not an object"
22, ReferenceError, "XXX does not have a constructor"
23, ReferenceError, "XXX does not have a value"
24, ReferenceError, "XXX is not a function"
25, SyntaxError, "Expected: XXX"
26, Error, "XXX cannot work with instances of this class"
27, InternalError, "Stack overrun"
28, FatalError, "Out of memory"
29, FatalError, "Uncaught exception XXX"
30, SyntaxError, "Illegal 'return' outside of a function body"
31, URIError, "Bad or invalid URI: XXX"
32, Error, "Cannot execute"
33, InternalError, "Internal error"
34, FatalError, "Execution halted"
35, FatalError, "Timeout while waiting for the engine"
36, FatalError, "Not implemented"
37, SyntaxError, "Character conversion error"
38, SyntaxError, "Partial multibyte character found"
39, SyntaxError, "More than one switch default"
40, TypeError, "XXX redeclared"
41, RangeError, "XXX is out of range"
42, SyntaxError, "Catch after unconditional catch"
43, EvalError, "Evaluation error"
44, TypeError, "Cannot convert"
45, ReferenceError, "Object is invalid"
46, ReferenceError, "XXX is read only"
47, TypeError, "Data type mismatch"
48, IOError, "File or folder does not exist"
49, IOError, "File or folder already exists"
50, IOError, "I/O device is not open"
51, IOError, "Read past EOF"
52, IOError, "I/O error"
53, ReferenceError, "Permission denied"
55, Error, "Object does not support the property or method 'XXX'"
56, IOError, "Cannot connect to XXX"
57, IOError, "Cannot resolve reference"
58, IOError, "I/O Timeout"
59, Error, "No response"
501, Error, "Unknown UI element type 'XXX'"
502, Error, "UI element type is required"
503, Error, "Unknown list item type 'XXX'"
504, Error, "List item type is required"
505, Error, "selection target 'XXX' is not a list index or ListItem"
506, Error, "Error creating UI framework control for 'XXX'"
507, Error, "Error setting initial bounds for 'XXX'"
508, Error, "Error setting initial text for 'XXX'"
509, Error, "Invalid image data"
510, Error, "Incompatible version of Mondo 'XXX'"
1050, Error, "Generic Mac OS error occurred"
1051, Error, "Generic Mac OS error occurred in the OSA subsystem"
1052, Error, "Generic Windows error occurred"
1200, Error, "Internal error"
1201, Error, "Memory Error"
1202, Error, "Not implemented"
1205, Error, "Unknown exception"
1206, Error, "Host is busy"
1207, Error, "Internal error (require failed)"
1208, Error, "NULL pointer was encountered"
1209, Error, "clone not allowed"
1220, Error, "Illegal Argument"
1221, Error, "Wrong number of arguments"
1222, Error, "Too many arguments"
1223, Error, "String value expected"
1224, Error, "Numeric value expected"
1225, Error, "Object expected"
1226, Error, "Enumerated value expected"
1227, Error, "Wrong type of enumerated value"
1228, Error, "Boolean value expected"
1229, Error, "Array expected"
1230, Error, "File/Folder expected"
1231, Error, "Point value expected"
1232, Error, "Rectangle value expected"
1233, Error, "Expected a reference to an existing File/Folder"
1235, Error, "Numeric value (optionally in units) expected"
1236, Error, "Point value (optionally in units) expected"
1237, Error, "Rectangle value (optionally in units) expected"
1238, Error, "Required value is missing"
1239, Error, "Specified value greater than maximum allowed value"
1240, Error, "Specified value less than minimum allowed value"
1241, Error, "Unsupported type"
1242, Error, "Illegal argument - argument 1"
1243, Error, "Illegal argument - argument 2"
1244, Error, "Illegal argument - argument 3"
1245, Error, "Illegal argument - argument 4"
1246, Error, "Illegal argument - argument 5"
1247, Error, "Illegal argument - argument 6"
1248, Error, "Illegal argument - argument 7"
1249, Error, "Illegal argument - argument 8"
1250, Error, "Index out of bounds"
1251, Error, "JavaScript enige was not initialized"
1252, Error, "JavaScript code was missing"
1261, Error, "operation not supported on this object"
1262, Error, "requested property not available for this object"
1265, Error, "this object cannot be deleted"
1266, Error, "the new object cannot be created at the specified location"
1267, Error, "the object cannot be moved the specified location"
1268, Error, "the object could not be created"
1280, Error, "The property was not initialized"
1281, Error, "Property value out of allowed range"
1282, Error, "Property is read/only and cannot be changed"
1283, Error, "Not a property"
1284, Error, "Not a method"
1285, Error, "Property not found for this object"
1286, Error, "Property is write/only"
1287, Error, "Method not found for this object"
1288, Error, "Command not found for this object"
1302, Error, "No such element"
1304, Error, "The collection does not support getting elements by name"
1305, Error, "The specified collection does not exist"
1306, Error, "You cannot access elements of this type by ID"
1310, Error, "You cannot add a text line"
1311, Error, "The specified text range is invalid"
1320, Error, "Invalid enumeration value"
1321, Error, "Invalid enumeration type"
1330, Error, "Invalid type"
1331, Error, "Unknown type"
1333, Error, "Object expected"
1351, Error, "Duplicate method got invalid arguments. If you omit the relative object then the location should also be omitted."
1352, Error, "String provided is too big for intended use."
1501, Error, "Apple event contained an unknown object container type"
1503, Error, "Apple event contained an unknown absolute position form"
1504, Error, "Apple event contained an unknown index position form"
1505, Error, "Apple event contained an unknown relative position form"
2000, Error, "Unsupported Variant type"
2001, Error, "Only arrays with dimension 1 are supported"
2002, Error, "Upper array bound is less than lower array bound"
2003, Error, "Provided Objecty does not belong to this host"
5000, Error, "Script engine not initialized"
5001, Error, "JavaScript execution error. XXX"
5002, Error, "Windows shell execution failure"
5003, Error, "<no additional error information>"
5050, Error, "SP suite not found"
5051, Error, "SP suite registration failed"
5052, Error, "SP suite not initialized"
5053, Error, "SP general interface error"
5100, Error, "Root Folder Not Found"
5149, Error, "Windows File System Error"


-X
xbytor

Errors Table

Post by xbytor »

One way that this information can be used is to throw your own exceptions.

Code: Select allfunction ftn(a, b) {

   if (a < 0) {
      Error.runtimeError(41, "a");
   }
   //....
};

If 'a' is less than 0, this will throw a RangeError that will have the message:
"a is out of range"

-X