Merge lp:~paul-lucas/zorba/bug-867027 into lp:zorba
- bug-867027
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Matthias Brantner | ||||
Approved revision: | 11224 | ||||
Merged at revision: | 11226 | ||||
Proposed branch: | lp:~paul-lucas/zorba/bug-867027 | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
504 lines (+147/-76) 11 files modified
ChangeLog (+1/-0) include/zorba/pregenerated/diagnostic_list.h (+6/-0) modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+12/-0) modules/w3c/pregenerated/xqt-errors.xq (+4/-4) src/compiler/translator/translator.cpp (+39/-5) src/diagnostics/diagnostic_en.xml (+26/-19) src/diagnostics/pregenerated/diagnostic_list.cpp (+9/-0) src/diagnostics/pregenerated/dict_en.cpp (+6/-3) src/diagnostics/pregenerated/dict_zed_keys.h (+2/-2) src/types/schema/LoadSchemaErrorHandler.cpp (+19/-31) src/types/schema/schema.cpp (+23/-12) |
||||
To merge this branch: | bzr merge lp:~paul-lucas/zorba/bug-867027 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Paul J. Lucas | Approve | ||
Review via email: mp+147257@code.launchpad.net |
Commit message
Created new error codes to handle errors other than what XQST0059 was intended for.
Description of the change
Created new error codes to handle errors other than what XQST0059 was intended for.
Paul J. Lucas (paul-lucas) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~paul-lucas/zorba/bug-867027 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug-867027-2013-02-
final status was:
3 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~paul-lucas/zorba/bug-867027 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug-867027-2013-02-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~paul-lucas/zorba/bug-867027 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug-867027-2013-02-
final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-867027-2013-02-
All tests succeeded!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Approve, 1 Pending.
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-867027-2013-02-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' |
2 | --- ChangeLog 2013-02-03 17:44:39 +0000 |
3 | +++ ChangeLog 2013-02-08 02:57:22 +0000 |
4 | @@ -15,6 +15,7 @@ |
5 | collection). |
6 | |
7 | Bug Fixes/Other Changes: |
8 | + * Fixed bug #867027 (XQST0059 error messages inconsistent) |
9 | * Fixed bug #1095889 (Improve error message for xml-parsing error). |
10 | * NaN items are considered equal to each other during grouping |
11 | * Fixed bug #855481 (Too small time types on Windows). |
12 | |
13 | === modified file 'include/zorba/pregenerated/diagnostic_list.h' |
14 | --- include/zorba/pregenerated/diagnostic_list.h 2013-01-23 17:24:44 +0000 |
15 | +++ include/zorba/pregenerated/diagnostic_list.h 2013-02-08 02:57:22 +0000 |
16 | @@ -422,6 +422,8 @@ |
17 | |
18 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0013_FXCHARHEAP_EXCEPTION; |
19 | |
20 | +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0014_OUT_OF_MEMORY; |
21 | + |
22 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0016_RESERVED_MODULE_TARGET_NAMESPACE; |
23 | |
24 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0017_FILE_ACCESS_DISABLED; |
25 | @@ -446,6 +448,10 @@ |
26 | |
27 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0032_ERROR_TRANSFORMING_XQUERYX_TO_XQUERY; |
28 | |
29 | +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0033_SCHEMA_XML_ERROR; |
30 | + |
31 | +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0035_SCHEMA_UNEXPECTED_ERROR; |
32 | + |
33 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0036_BREAKITERATOR_CREATION_FAILED; |
34 | |
35 | extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0037_INAPPROPRIATE_MODULE_VERSION; |
36 | |
37 | === modified file 'modules/com/zorba-xquery/www/modules/pregenerated/errors.xq' |
38 | --- modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2013-01-08 00:31:47 +0000 |
39 | +++ modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2013-02-08 02:57:22 +0000 |
40 | @@ -113,6 +113,10 @@ |
41 | |
42 | (:~ |
43 | :) |
44 | +declare variable $zerr:ZXQP0014 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0014"); |
45 | + |
46 | +(:~ |
47 | +:) |
48 | declare variable $zerr:ZXQP0016 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0016"); |
49 | |
50 | (:~ |
51 | @@ -161,6 +165,14 @@ |
52 | |
53 | (:~ |
54 | :) |
55 | +declare variable $zerr:ZXQP0033 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0033"); |
56 | + |
57 | +(:~ |
58 | +:) |
59 | +declare variable $zerr:ZXQP0035 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0035"); |
60 | + |
61 | +(:~ |
62 | +:) |
63 | declare variable $zerr:ZXQP0036 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0036"); |
64 | |
65 | (:~ |
66 | |
67 | === modified file 'modules/w3c/pregenerated/xqt-errors.xq' |
68 | --- modules/w3c/pregenerated/xqt-errors.xq 2013-01-19 20:47:55 +0000 |
69 | +++ modules/w3c/pregenerated/xqt-errors.xq 2013-02-08 02:57:22 +0000 |
70 | @@ -420,8 +420,8 @@ |
71 | |
72 | (:~ |
73 | : |
74 | - : It is a static error if a schema import binds a namespace prefix but does |
75 | - : not specify a target namespace other than a zero-length string. |
76 | + : It is a static error if a schema import binds a namespace prefix but |
77 | + : does not specify a target namespace other than a zero-length string. |
78 | : |
79 | : @see http://www.w3.org/2005/xqt-errors |
80 | :) |
81 | @@ -439,8 +439,8 @@ |
82 | (:~ |
83 | : |
84 | : It is a static error if an implementation is unable to process a schema |
85 | - : or module import by finding a schema or module with the specified target |
86 | - : namespace. |
87 | + : or module import by finding a schema or module with the specified |
88 | + : target namespace. |
89 | : |
90 | : @see http://www.w3.org/2005/xqt-errors |
91 | :) |
92 | |
93 | === modified file 'src/compiler/translator/translator.cpp' |
94 | --- src/compiler/translator/translator.cpp 2013-01-29 06:01:31 +0000 |
95 | +++ src/compiler/translator/translator.cpp 2013-02-08 02:57:22 +0000 |
96 | @@ -2197,7 +2197,13 @@ |
97 | } |
98 | |
99 | if ( lStream == NULL ) { |
100 | - throw XQUERY_EXCEPTION(err::XQST0059, ERROR_PARAMS(lNsURI, lErrorMessage)); |
101 | + throw XQUERY_EXCEPTION( |
102 | + err::XQST0059, |
103 | + ERROR_PARAMS( |
104 | + ZED( XQST0059_SpecificationMessage ), |
105 | + lNsURI, "", lErrorMessage |
106 | + ) |
107 | + ); |
108 | } |
109 | |
110 | // If we got this far, we have a valid StreamResource. |
111 | @@ -3086,7 +3092,14 @@ |
112 | if (theModulesInfo->mod_ns_map.get(compURI, importedNS)) |
113 | { |
114 | if (importedNS != targetNS) |
115 | - RAISE_ERROR(err::XQST0059, loc, ERROR_PARAMS(targetNS, compURI)); |
116 | + throw XQUERY_EXCEPTION( |
117 | + err::XQST0059, |
118 | + ERROR_PARAMS( |
119 | + ZED( XQST0059_SpecificationMessage ), |
120 | + targetNS, compURI |
121 | + ), |
122 | + ERROR_LOC( loc ) |
123 | + ); |
124 | |
125 | bool found = theModulesInfo->mod_sctx_map.get(compURI, importedSctx); |
126 | ZORBA_ASSERT(found); |
127 | @@ -3129,7 +3142,14 @@ |
128 | } |
129 | else |
130 | { |
131 | - RAISE_ERROR(err::XQST0059, loc, ERROR_PARAMS(targetNS, compURI, lErrorMessage)); |
132 | + throw XQUERY_EXCEPTION( |
133 | + err::XQST0059, |
134 | + ERROR_PARAMS( |
135 | + ZED( XQST0059_SpecificationMessage ), |
136 | + targetNS, compURI, lErrorMessage |
137 | + ), |
138 | + ERROR_LOC( loc ) |
139 | + ); |
140 | } |
141 | |
142 | // Get the parent of the query root sctx. This is the user-specified sctx |
143 | @@ -3185,7 +3205,14 @@ |
144 | // Also make sure that the imported module is a library module |
145 | LibraryModule* mod_ast = dynamic_cast<LibraryModule *>(&*ast); |
146 | if (mod_ast == NULL) |
147 | - RAISE_ERROR(err::XQST0059, loc, ERROR_PARAMS(targetNS, compURI)); |
148 | + throw XQUERY_EXCEPTION( |
149 | + err::XQST0059, |
150 | + ERROR_PARAMS( |
151 | + ZED( XQST0059_SpecificationMessage ), |
152 | + targetNS, compURI |
153 | + ), |
154 | + ERROR_LOC( loc ) |
155 | + ); |
156 | |
157 | importedNS = mod_ast->get_decl()->get_target_namespace().str(); |
158 | |
159 | @@ -3193,7 +3220,14 @@ |
160 | throw XQUERY_EXCEPTION(err::XQST0088, ERROR_LOC(loc)); |
161 | |
162 | if (importedNS != targetNS) |
163 | - RAISE_ERROR(err::XQST0059, loc, ERROR_PARAMS(targetNS, compURI)); |
164 | + throw XQUERY_EXCEPTION( |
165 | + err::XQST0059, |
166 | + ERROR_PARAMS( |
167 | + ZED( XQST0059_SpecificationMessage ), |
168 | + targetNS, compURI |
169 | + ), |
170 | + ERROR_LOC( loc ) |
171 | + ); |
172 | |
173 | // translate the imported module |
174 | translate_aux(theRootTranslator, |
175 | |
176 | === modified file 'src/diagnostics/diagnostic_en.xml' |
177 | --- src/diagnostics/diagnostic_en.xml 2013-02-03 19:01:15 +0000 |
178 | +++ src/diagnostics/diagnostic_en.xml 2013-02-08 02:57:22 +0000 |
179 | @@ -572,27 +572,33 @@ |
180 | |
181 | <diagnostic code="XQST0057"> |
182 | <comment> |
183 | - It is a static error if a schema import binds a namespace prefix but does |
184 | - not specify a target namespace other than a zero-length string. |
185 | + It is a static error if a schema import binds a namespace prefix but |
186 | + does not specify a target namespace other than a zero-length string. |
187 | </comment> |
188 | <value>empty target namespace</value> |
189 | </diagnostic> |
190 | |
191 | <diagnostic code="XQST0058"> |
192 | <comment> |
193 | - It is a static error if multiple schema imports specify the same target |
194 | - namespace. |
195 | + It is a static error if multiple schema imports specify the same target |
196 | + namespace. |
197 | </comment> |
198 | <value>"$1": duplicate target namespace</value> |
199 | </diagnostic> |
200 | |
201 | <diagnostic code="XQST0059"> |
202 | <comment> |
203 | - It is a static error if an implementation is unable to process a schema |
204 | - or module import by finding a schema or module with the specified target |
205 | - namespace. |
206 | + It is a static error if an implementation is unable to process a schema |
207 | + or module import by finding a schema or module with the specified |
208 | + target namespace. |
209 | </comment> |
210 | - <value>"$1": target namespace not found for schema/module${ 2}</value> |
211 | + <value>$1</value> |
212 | + <entry key="SpecificationMessage"> |
213 | + <value>"$2": target namespace not found for schema/module${ "3"}${: 4}</value> |
214 | + </entry> |
215 | + <entry key="XercesMessage"> |
216 | + <value>$2,$3: error in schema${ with System ID "4"}${ with Public ID "5"}${: 6}</value> |
217 | + </entry> |
218 | </diagnostic> |
219 | |
220 | <diagnostic code="XQST0060"> |
221 | @@ -1964,6 +1970,10 @@ |
222 | <value>FxCharHeap error: $1 ($2)</value> |
223 | </diagnostic> |
224 | |
225 | + <diagnostic code="ZXQP0014" name="OUT_OF_MEMORY"> |
226 | + <value>${"1": }out of memory${: 2}</value> |
227 | + </diagnostic> |
228 | + |
229 | <diagnostic code="ZXQP0016" name="RESERVED_MODULE_TARGET_NAMESPACE"> |
230 | <value>"$1": reserved module target namespace</value> |
231 | </diagnostic> |
232 | @@ -1986,7 +1996,6 @@ |
233 | |
234 | <diagnostic code="ZXQP0025" name="COULD_NOT_FETCH_RESOURCE"> |
235 | <value>"$1": could not fetch resource${; reason: 2}</value> |
236 | - |
237 | <entry key="RESOURCE_NOT_FOUND"> |
238 | <value>resource not found</value> |
239 | </entry> |
240 | @@ -2016,6 +2025,14 @@ |
241 | <value>error transforming XQueryX to XQuery${: 1}</value> |
242 | </diagnostic> |
243 | |
244 | + <diagnostic code="ZXQP0033" name="SCHEMA_XML_ERROR"> |
245 | + <value>${"1": }XML error in schema${: 2}</value> |
246 | + </diagnostic> |
247 | + |
248 | + <diagnostic code="ZXQP0035" name="SCHEMA_UNEXPECTED_ERROR"> |
249 | + <value>${"1": }unexpected error in schema${: 2}</value> |
250 | + </diagnostic> |
251 | + |
252 | <diagnostic code="ZXQP0036" name="BREAKITERATOR_CREATION_FAILED"> |
253 | <value>BreakIterator creation failed</value> |
254 | </diagnostic> |
255 | @@ -2037,9 +2054,7 @@ |
256 | </diagnostic> |
257 | |
258 | <diagnostic code="ZXQP0050" name="FEATURE_NOT_AVAILABLE"> |
259 | - |
260 | <value>"$1": feature not available</value> |
261 | - |
262 | </diagnostic> |
263 | |
264 | <diagnostic code="ZXQP0060" name="OPTION_NOT_KNOWN"> |
265 | @@ -3719,14 +3734,6 @@ |
266 | <value>the standalone attribute has a value other than "omit"</value> |
267 | </entry> |
268 | |
269 | - <entry key="SchemaOutOfMemory"> |
270 | - <value>OutOfMemoryException during parsing</value> |
271 | - </entry> |
272 | - |
273 | - <entry key="SchemaParseError"> |
274 | - <value>error during parsing</value> |
275 | - </entry> |
276 | - |
277 | <entry key="SchemaUnexpected"> |
278 | <value>unexpected exception during parsing</value> |
279 | </entry> |
280 | |
281 | === modified file 'src/diagnostics/pregenerated/diagnostic_list.cpp' |
282 | --- src/diagnostics/pregenerated/diagnostic_list.cpp 2013-01-23 17:24:44 +0000 |
283 | +++ src/diagnostics/pregenerated/diagnostic_list.cpp 2013-02-08 02:57:22 +0000 |
284 | @@ -613,6 +613,9 @@ |
285 | ZorbaErrorCode ZXQP0013_FXCHARHEAP_EXCEPTION( "ZXQP0013" ); |
286 | |
287 | |
288 | +ZorbaErrorCode ZXQP0014_OUT_OF_MEMORY( "ZXQP0014" ); |
289 | + |
290 | + |
291 | ZorbaErrorCode ZXQP0016_RESERVED_MODULE_TARGET_NAMESPACE( "ZXQP0016" ); |
292 | |
293 | |
294 | @@ -649,6 +652,12 @@ |
295 | ZorbaErrorCode ZXQP0032_ERROR_TRANSFORMING_XQUERYX_TO_XQUERY( "ZXQP0032" ); |
296 | |
297 | |
298 | +ZorbaErrorCode ZXQP0033_SCHEMA_XML_ERROR( "ZXQP0033" ); |
299 | + |
300 | + |
301 | +ZorbaErrorCode ZXQP0035_SCHEMA_UNEXPECTED_ERROR( "ZXQP0035" ); |
302 | + |
303 | + |
304 | ZorbaErrorCode ZXQP0036_BREAKITERATOR_CREATION_FAILED( "ZXQP0036" ); |
305 | |
306 | |
307 | |
308 | === modified file 'src/diagnostics/pregenerated/dict_en.cpp' |
309 | --- src/diagnostics/pregenerated/dict_en.cpp 2013-02-03 19:01:15 +0000 |
310 | +++ src/diagnostics/pregenerated/dict_en.cpp 2013-02-08 02:57:22 +0000 |
311 | @@ -230,7 +230,7 @@ |
312 | { "XQST0055", "multiple copy-namespaces declarations" }, |
313 | { "XQST0057", "empty target namespace" }, |
314 | { "XQST0058", "\"$1\": duplicate target namespace" }, |
315 | - { "XQST0059", "\"$1\": target namespace not found for schema/module${ 2}" }, |
316 | + { "XQST0059", "$1" }, |
317 | { "XQST0060", "\"$1\": function name has a null namespace URI" }, |
318 | { "XQST0065", "multiple ordering mode declaraions" }, |
319 | { "XQST0066", "multiple element/type/function namespace declarations" }, |
320 | @@ -498,6 +498,7 @@ |
321 | { "ZXQP0011", "\"$1\": invalid locale" }, |
322 | { "ZXQP0012", "\"$1\": unknown locale" }, |
323 | { "ZXQP0013", "FxCharHeap error: $1 ($2)" }, |
324 | + { "ZXQP0014", "${\"1\": }out of memory${: 2}" }, |
325 | { "ZXQP0016", "\"$1\": reserved module target namespace" }, |
326 | { "ZXQP0017", "file access disabled" }, |
327 | { "ZXQP0020", "\"$1\": invalid URI${: 2}" }, |
328 | @@ -510,6 +511,8 @@ |
329 | { "ZXQP0030", "deadlock" }, |
330 | { "ZXQP0031", "malformed XQueryX XML input${: 1}" }, |
331 | { "ZXQP0032", "error transforming XQueryX to XQuery${: 1}" }, |
332 | + { "ZXQP0033", "${\"1\": }XML error in schema${: 2}" }, |
333 | + { "ZXQP0035", "${\"1\": }unexpected error in schema${: 2}" }, |
334 | { "ZXQP0036", "BreakIterator creation failed" }, |
335 | { "ZXQP0037", "\"$1\": loaded module version \"$2\" does not match import version specification" }, |
336 | { "ZXQP0038", "Query requires Zorba version \"$1\"; you are running Zorba \"$2\"" }, |
337 | @@ -799,8 +802,6 @@ |
338 | #endif |
339 | { "~SEPM0009_Not10", "the version parameter has a value other than \"1.0\" and the doctype-system parameter is specified" }, |
340 | { "~SEPM0009_NotOmit", "the standalone attribute has a value other than \"omit\"" }, |
341 | - { "~SchemaOutOfMemory", "OutOfMemoryException during parsing" }, |
342 | - { "~SchemaParseError", "error during parsing" }, |
343 | { "~SchemaUnexpected", "unexpected exception during parsing" }, |
344 | { "~SearchKeyTypeMismatch_234", "\"$2\": search key type for index \"$3\" does not match expected type \"$4\"" }, |
345 | { "~SearchKeyTypeNoProbeIndex_23", "\"$2\": search key type can not probe index \"$3\"" }, |
346 | @@ -918,6 +919,8 @@ |
347 | { "~XPTY0117_NodeCast", "Cannot cast node to xs:QName" }, |
348 | { "~XPTY0117_NotationParam_23", "$2 can not be promoted to parameter type xs:NOTATION of function $3()" }, |
349 | { "~XQST0046_BadHexDigit_3", "'$3': invalid hexedecimal digit" }, |
350 | + { "~XQST0059_SpecificationMessage", "\"$2\": target namespace not found for schema/module${ \"3\"}${: 4}" }, |
351 | + { "~XQST0059_XercesMessage", "$2,$3: error in schema${ with System ID \"4\"}${ with Public ID \"5\"}${: 6}" }, |
352 | { "~XQST0106_CONFLICTING", "conflicting" }, |
353 | { "~XQST0106_THE_SAME", "the same" }, |
354 | { "~XUDY0021_AttributeName", "\"$3\": attribute with the same name already exists" }, |
355 | |
356 | === modified file 'src/diagnostics/pregenerated/dict_zed_keys.h' |
357 | --- src/diagnostics/pregenerated/dict_zed_keys.h 2013-02-03 19:01:15 +0000 |
358 | +++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-02-08 02:57:22 +0000 |
359 | @@ -50,6 +50,8 @@ |
360 | #define ZED_XPTY0117_NodeCast "~XPTY0117_NodeCast" |
361 | #define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23" |
362 | #define ZED_XQST0046_BadHexDigit_3 "~XQST0046_BadHexDigit_3" |
363 | +#define ZED_XQST0059_SpecificationMessage "~XQST0059_SpecificationMessage" |
364 | +#define ZED_XQST0059_XercesMessage "~XQST0059_XercesMessage" |
365 | #define ZED_XQST0106_THE_SAME "~XQST0106_THE_SAME" |
366 | #define ZED_XQST0106_CONFLICTING "~XQST0106_CONFLICTING" |
367 | #define ZED_XPDY0002_VariableHasNoValue_2 "~XPDY0002_VariableHasNoValue_2" |
368 | @@ -255,8 +257,6 @@ |
369 | #define ZED_QuotedColon_23 "~QuotedColon_23" |
370 | #define ZED_SEPM0009_Not10 "~SEPM0009_Not10" |
371 | #define ZED_SEPM0009_NotOmit "~SEPM0009_NotOmit" |
372 | -#define ZED_SchemaOutOfMemory "~SchemaOutOfMemory" |
373 | -#define ZED_SchemaParseError "~SchemaParseError" |
374 | #define ZED_SchemaUnexpected "~SchemaUnexpected" |
375 | #define ZED_SearchKeyTypeMismatch_234 "~SearchKeyTypeMismatch_234" |
376 | #define ZED_SearchKeyTypeNoProbeIndex_23 "~SearchKeyTypeNoProbeIndex_23" |
377 | |
378 | === modified file 'src/types/schema/LoadSchemaErrorHandler.cpp' |
379 | --- src/types/schema/LoadSchemaErrorHandler.cpp 2012-09-19 21:16:15 +0000 |
380 | +++ src/types/schema/LoadSchemaErrorHandler.cpp 2013-02-08 02:57:22 +0000 |
381 | @@ -50,42 +50,30 @@ |
382 | // --------------------------------------------------------------------------- |
383 | void LoadSchemaErrorHandler::error(const XERCES_CPP_NAMESPACE::SAXParseException& e) |
384 | { |
385 | + zstring system_id, public_id; |
386 | + if ( e.getSystemId() ) |
387 | + system_id = StrX( e.getSystemId() ).localFormOrDefault( "" ); |
388 | + if ( e.getPublicId() ) |
389 | + public_id = StrX( e.getPublicId() ).localFormOrDefault( "" ); |
390 | + |
391 | theSawErrors = true; |
392 | - std::ostringstream os; |
393 | - os << "Error in schema "; |
394 | - |
395 | -if ( e.getSystemId() != NULL ) |
396 | - os << "with system id " << StrX(e.getSystemId()); |
397 | - else if ( e.getPublicId() != NULL ) |
398 | - os << "with public id " << StrX(e.getPublicId()); |
399 | - else |
400 | - os << "without id"; |
401 | - |
402 | - os << ", line " << e.getLineNumber() |
403 | - << ", column " << e.getColumnNumber() << "." << std::endl |
404 | - << StrX(e.getMessage()); |
405 | - |
406 | - throw XQUERY_EXCEPTION( err::XQST0059, ERROR_PARAMS(os.str()), ERROR_LOC(theQueryLoc) ); |
407 | + throw XQUERY_EXCEPTION( |
408 | + err::XQST0059, |
409 | + ERROR_PARAMS( |
410 | + ZED( XQST0059_XercesMessage ), |
411 | + e.getLineNumber(), |
412 | + e.getColumnNumber(), |
413 | + system_id, |
414 | + public_id, |
415 | + StrX( e.getMessage() ).localFormOrDefault( "" ) |
416 | + ), |
417 | + ERROR_LOC( theQueryLoc ) |
418 | + ); |
419 | } |
420 | |
421 | void LoadSchemaErrorHandler::fatalError(const XERCES_CPP_NAMESPACE::SAXParseException& e) |
422 | { |
423 | - theSawErrors = true; |
424 | - std::ostringstream os; |
425 | - os << "Fatal error in schema "; |
426 | - |
427 | - if ( e.getSystemId() != NULL ) |
428 | - os << "with system id " << StrX(e.getSystemId()); |
429 | - else if ( e.getPublicId() != NULL ) |
430 | - os << "with public id " << StrX(e.getPublicId()); |
431 | - else |
432 | - os << "without id"; |
433 | - |
434 | - os << ", line " << e.getLineNumber() |
435 | - << ", column " << e.getColumnNumber() << "." << std::endl |
436 | - << StrX(e.getMessage()); |
437 | - |
438 | - throw XQUERY_EXCEPTION( err::XQST0059, ERROR_PARAMS(os.str()), ERROR_LOC(theQueryLoc) ); |
439 | + error( e ); |
440 | } |
441 | |
442 | void LoadSchemaErrorHandler::warning(const XERCES_CPP_NAMESPACE::SAXParseException& e) |
443 | |
444 | === modified file 'src/types/schema/schema.cpp' |
445 | --- src/types/schema/schema.cpp 2013-01-24 10:49:06 +0000 |
446 | +++ src/types/schema/schema.cpp 2013-02-08 02:57:22 +0000 |
447 | @@ -262,8 +262,13 @@ |
448 | else { |
449 | // We didn't find it. If we return NULL here, Xerces will try to |
450 | // resolve it its own way, which we don't want to happen. |
451 | - throw XQUERY_EXCEPTION( err::XQST0059, |
452 | - ERROR_PARAMS( lResolved )); |
453 | + throw XQUERY_EXCEPTION( |
454 | + err::XQST0059, |
455 | + ERROR_PARAMS( |
456 | + ZED( XQST0059_SpecificationMessage ), |
457 | + lResolved |
458 | + ) |
459 | + ); |
460 | } |
461 | } |
462 | catch (ZorbaException const& e) { |
463 | @@ -478,25 +483,31 @@ |
464 | } |
465 | catch (const OutOfMemoryException&) |
466 | { |
467 | - throw XQUERY_EXCEPTION( err::XQST0059, |
468 | - ERROR_PARAMS( std::string(xsdURL), ZED( SchemaOutOfMemory )), |
469 | - ERROR_LOC( loc ) ); |
470 | + throw XQUERY_EXCEPTION( |
471 | + zerr::ZXQP0014_OUT_OF_MEMORY, |
472 | + ERROR_PARAMS( xsdURL ), |
473 | + ERROR_LOC( loc ) |
474 | + ); |
475 | } |
476 | catch (const XMLException& e) |
477 | { |
478 | - throw XQUERY_EXCEPTION( err::XQST0059, |
479 | - ERROR_PARAMS( std::string(xsdURL), ZED( SchemaParseError ), StrX(e.getMessage())), |
480 | - ERROR_LOC( loc ) ); |
481 | + throw XQUERY_EXCEPTION( |
482 | + zerr::ZXQP0033_SCHEMA_XML_ERROR, |
483 | + ERROR_PARAMS( xsdURL, e.getMessage() ), |
484 | + ERROR_LOC( loc ) |
485 | + ); |
486 | } |
487 | - catch (const ZorbaException& /* e */) |
488 | + catch (const ZorbaException&) |
489 | { |
490 | throw; |
491 | } |
492 | catch (...) |
493 | { |
494 | - throw XQUERY_EXCEPTION( err::XQST0059, |
495 | - ERROR_PARAMS( std::string(xsdURL), ZED( SchemaUnexpected )), |
496 | - ERROR_LOC( loc ) ); |
497 | + throw XQUERY_EXCEPTION( |
498 | + zerr::ZXQP0035_SCHEMA_UNEXPECTED_ERROR, |
499 | + ERROR_PARAMS( xsdURL ), |
500 | + ERROR_LOC( loc ) |
501 | + ); |
502 | } |
503 | |
504 | #ifdef DO_PRINT_SCHEMA_INFO |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug-867027- 2013-02- 08T00-17- 47.56Z/ log.html
Log at: http://