forked from isabella232/indesign-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.jsx
More file actions
143 lines (138 loc) · 3.32 KB
/
errors.jsx
File metadata and controls
143 lines (138 loc) · 3.32 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// Error constants are defined here.
/* eslint-disable no-unused-vars */
/* This document list all the error which are possible from the scripts. The error object is built such that it has an error code and some error strings.
The error strings are constructed in a way such that the first string is default and a string literal. It is to be returned anyhow. The subsequent strings can be
strings having '^1' as placeholder replacement string. This replacement string can be replaced with relevant information. Based on the information
available the final error message can be created.
*/
var ErrorReplacementString = '^1'
var Errors = {
// Errors during processing: 1001-1999
InternalScriptError: {
errorCode: 1001,
errorStrings: [
'Internal script error. This should not had happened.'
]
},
ProcessingErrorOccurred: {
errorCode: 1002,
errorStrings: [
'Error during processing.'
]
},
PDFPresetNotSet: {
errorCode: 1003,
errorStrings: [
'No PDF Preset could be set.'
]
},
OutputDirError: {
errorCode: 1004,
errorStrings: [
'Unable to create specified output directory.'
]
},
RelinkError: {
errorCode: 1005,
errorStrings: [
'Unable to relink.',
'Relink failed for ^1'
]
},
PlaceError: {
errorCode: 1006,
errorStrings: [
'Unable to place.',
'Place failed for ^1'
]
},
// Errors in input: 2001-2999
ArrayExpected: {
errorCode: 2001,
errorStrings: [
'Expected array',
'for property ^1.'
]
},
ParsingBoolError: {
errorCode: 2002,
errorStrings: [
'Expected boolean.',
'^1 is the provided value',
'for property ^1.'
]
},
ParsingIntError: {
errorCode: 2003,
errorStrings: [
'Expected integer.',
'^1 is the provided value',
'for property ^1.'
]
},
ParsingFloatError: {
errorCode: 2004,
errorStrings: [
'Expected number.',
'^1 is the provided value',
'for property ^1.'
]
},
ParsingStringError: {
errorCode: 2005,
errorStrings: [
'Expected string.',
'^1 is the provided value',
'for property ^1.'
]
},
OutOfBound: {
errorCode: 2006,
errorStrings: [
'Incorrect range provided.',
'Culprit Value is ^1.'
]
},
MissingKey: {
errorCode: 2007,
errorStrings: [
'Key not found in object.',
'Missing key is ^1.'
]
},
EnumError: {
errorCode: 2008,
errorStrings: [
'No matching enum value found.',
'^1 is the provided value',
'for property ^1.'
]
},
MissingParams: {
errorCode: 2013,
errorStrings: [
'Either the \'params\' is not found in the request or it is not in the correct format.'
]
},
ObjectExpected: {
errorCode: 2016,
errorStrings: [
'Expected object',
'for property ^1.'
]
},
AtLeastOneInternalParamShouldBePresent: {
errorCode: 2017,
errorStrings: [
'At least one of the parameters should be present.',
'Missing parameters are ^1'
]
},
// Errors coming from IDS and sent under ProcessingErrorOccurred. These are specific errors which need string change while returning to the user.
CannotOpenFileError: {
errorCode: 29447, // kCannotOpenFileError
errorStrings: [
'Cannot open file.'
]
}
}