Merge lp:~zorba-coders/zorba/feature-applied_loc into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11143
Merged at revision: 11137
Proposed branch: lp:~zorba-coders/zorba/feature-applied_loc
Merge into: lp:zorba
Diff against target: 672 lines (+301/-118)
12 files modified
include/zorba/internal/diagnostic.h (+3/-2)
include/zorba/internal/unique_ptr.h (+3/-4)
include/zorba/xquery_exception.h (+107/-23)
src/diagnostics/diagnostic_en.xml (+4/-5)
src/diagnostics/pregenerated/dict_en.cpp (+1/-1)
src/diagnostics/pregenerated/dict_zed_keys.h (+1/-1)
src/diagnostics/xquery_exception.cpp (+77/-38)
src/diagnostics/xquery_exception.h (+100/-0)
src/runtime/core/apply_updates.cpp (+2/-38)
test/rbkt/ExpQueryResults/zorba/index/undo1.xml.res (+1/-1)
test/rbkt/Queries/zorba/index/auctions2u.xq (+1/-1)
test/rbkt/Queries/zorba/index/undo1.xq (+1/-4)
To merge this branch: bzr merge lp:~zorba-coders/zorba/feature-applied_loc
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Paul J. Lucas Approve
Review via email: mp+137357@code.launchpad.net

Commit message

Added "applied at" location to XQueryException.

Description of the change

Added "applied at" location to XQueryException.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~paul-lucas/zorba/feature-applied_loc into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job feature-applied_loc-2012-12-01T00-16-48.221Z is
  finished. The final status was:

  2 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

The 2 tests that failed are because the tests make assumptions about the error message format. According to "bzr blame," Markos made the relevant changes to these tests. Markos: can you please fix the tests so they pass using the new "applied at" format?

11142. By Paul J. Lucas

No longer need old "applied at" key.

11143. By Markos Zaharioudakis

fixed failing tests

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job feature-applied_loc-2012-12-01T05-57-42.978Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/zorba/internal/diagnostic.h'
2--- include/zorba/internal/diagnostic.h 2012-11-17 18:44:55 +0000
3+++ include/zorba/internal/diagnostic.h 2012-12-01 05:48:20 +0000
4@@ -45,6 +45,7 @@
5 * A %location holds the file location of an error.
6 */
7 class ZORBA_DLL_PUBLIC location {
8+ typedef ztd::explicit_bool explicit_bool;
9 public:
10 /**
11 * The line-number type.
12@@ -159,8 +160,8 @@
13 *
14 * @return Returns \c true only if this %location has been set.
15 */
16- operator bool() const {
17- return !!line_;
18+ operator explicit_bool::type() const {
19+ return explicit_bool::value_of( line_ );
20 }
21
22 /**
23
24=== modified file 'include/zorba/internal/unique_ptr.h'
25--- include/zorba/internal/unique_ptr.h 2012-09-19 21:16:15 +0000
26+++ include/zorba/internal/unique_ptr.h 2012-12-01 05:48:20 +0000
27@@ -455,8 +455,7 @@
28 typedef typename ZORBA_TR1_NS::add_reference<D const>::type
29 deleter_const_reference;
30
31- struct pointer_conversion { int valid; };
32- typedef int pointer_conversion::*explicit_bool;
33+ typedef zorba::internal::ztd::explicit_bool explicit_bool;
34
35 public:
36 typedef T element_type;
37@@ -512,8 +511,8 @@
38 std::swap( storage_, p.storage_ );
39 }
40
41- operator explicit_bool() const throw() {
42- return get() ? &pointer_conversion::valid : 0;
43+ operator explicit_bool::type() const throw() {
44+ return explicit_bool::value_of( get() );
45 }
46
47 private:
48
49=== modified file 'include/zorba/xquery_exception.h'
50--- include/zorba/xquery_exception.h 2012-09-19 21:16:15 +0000
51+++ include/zorba/xquery_exception.h 2012-12-01 05:48:20 +0000
52@@ -58,6 +58,17 @@
53 */
54 XQueryException& operator=( XQueryException const &from );
55
56+ ////////// source file/line location ////////////////////////////////////////
57+
58+ /**
59+ * Checks whether the XQuery source-code location has been set.
60+ *
61+ * @return Returns \c true only if said has been set.
62+ */
63+ bool has_source() const throw() {
64+ return source_loc_;
65+ }
66+
67 /**
68 * Sets the XQuery source-code URI name, line, and column numbers.
69 *
70@@ -67,24 +78,14 @@
71 * @param line_end The source-code URI end line number.
72 * @param column_end The source-code URI end column number.
73 */
74- void set_source(
75- char const *uri,
76- line_type line,
77- column_type column = 0,
78- line_type line_end = 0,
79- column_type column_end = 0 );
80-
81- /**
82- * Checks whether the XQuery source location has been set.
83- *
84- * @return Returns \c true only if the source location has been set.
85- */
86- bool has_source() const throw() {
87- return source_loc_;
88- }
89-
90- /**
91- * Gets the XQuery source URI containing the error.
92+ void set_source( char const *uri,
93+ line_type line,
94+ column_type column = 0,
95+ line_type line_end = 0,
96+ column_type column_end = 0 );
97+
98+ /**
99+ * Gets the XQuery source-code URI containing the error.
100 *
101 * @return Returns said URI or the empty string if unset.
102 */
103@@ -128,6 +129,84 @@
104 return source_loc_.column_end();
105 }
106
107+ ////////// "applied at" file/line location //////////////////////////////////
108+
109+ /**
110+ * Checks whether the XQuery "applied at" location has been set.
111+ *
112+ * @return Returns \c true only if the "applied at" location has been set.
113+ */
114+ bool has_applied() const throw() {
115+ return applied_loc_;
116+ }
117+
118+ /**
119+ * Sets the XQuery source-code "applied at" URI name, line, and column
120+ * numbers.
121+ *
122+ * @param uri The source-code "applied at" URI name. If either the null
123+ * pointer or the empty string, \c source_uri() is used.
124+ * @param line The source-code "applied at" URI line number.
125+ * @param column The source-code "applied at" URI column number.
126+ * @param line_end The source-code "applied at" URI end line number.
127+ * @param column_end The source-code "applied at" URI end column number.
128+ */
129+ void set_applied( char const *uri,
130+ line_type line,
131+ column_type column = 0,
132+ line_type line_end = 0,
133+ column_type column_end = 0 );
134+
135+ /**
136+ * Gets the XQuery source-code "applied at" URI containing the error.
137+ *
138+ * @return Returns said URI or the empty string if unset.
139+ */
140+ char const* applied_uri() const throw() {
141+ return applied_loc_.file();
142+ }
143+
144+ /**
145+ * Gets the XQuery source-code "applied at" line number containing the error.
146+ *
147+ * @return Returns said line number or 0 if unset.
148+ */
149+ line_type applied_line() const throw() {
150+ return applied_loc_.line();
151+ }
152+
153+ /**
154+ * Gets the XQuery source-code "applied at" column number containing the
155+ * error.
156+ *
157+ * @return Returns said column number or 0 if unset.
158+ */
159+ column_type applied_column() const throw() {
160+ return applied_loc_.column();
161+ }
162+
163+ /**
164+ * Gets the XQuery source-code "applied at" end line number containing the
165+ * error.
166+ *
167+ * @return Returns said line number or 0 if unset.
168+ */
169+ line_type applied_line_end() const throw() {
170+ return applied_loc_.line_end();
171+ }
172+
173+ /**
174+ * Gets the XQuery source-code "applied at" end column number containing the
175+ * error.
176+ *
177+ * @return Returns said column number or 0 if unset.
178+ */
179+ column_type applied_column_end() const throw() {
180+ return applied_loc_.column_end();
181+ }
182+
183+ ////////// XQuery stack trace ///////////////////////////////////////////////
184+
185 /**
186 * Gets the XQuery stack trace, if any.
187 *
188@@ -155,6 +234,9 @@
189 std::ostream& print( std::ostream &o ) const;
190
191 private:
192+ typedef internal::diagnostic::location location;
193+ typedef internal::diagnostic::parameters parameters;
194+
195 /**
196 * Constructs an %XQueryException.
197 *
198@@ -168,21 +250,23 @@
199 XQueryException( Diagnostic const &diagnostic, char const *raise_file,
200 line_type raise_line, char const *message );
201
202- internal::diagnostic::location source_loc_;
203+ location source_loc_;
204+ location applied_loc_;
205 XQueryStackTrace query_trace_;
206
207 friend XQueryException make_xquery_exception(
208 char const*, ZorbaException::line_type, Diagnostic const&,
209- internal::diagnostic::parameters const&,
210- internal::diagnostic::location const&
211+ parameters const&, location const&
212 );
213
214 friend XQueryException* new_xquery_exception(
215 char const*, ZorbaException::line_type, Diagnostic const&,
216- internal::diagnostic::parameters const&,
217- internal::diagnostic::location const&
218+ parameters const&, location const&
219 );
220
221+ friend void set_applied( ZorbaException&, char const*, line_type, column_type,
222+ line_type, column_type, bool );
223+
224 friend void set_source( ZorbaException&, char const*, line_type, column_type,
225 line_type, column_type, bool );
226
227
228=== modified file 'src/diagnostics/diagnostic_en.xml'
229--- src/diagnostics/diagnostic_en.xml 2012-11-20 18:17:10 +0000
230+++ src/diagnostics/diagnostic_en.xml 2012-12-01 05:48:20 +0000
231@@ -1480,10 +1480,6 @@
232 <entry key="AttributeName">
233 <value>"$3": attribute with the same name already exists</value>
234 </entry>
235-
236- <entry key="AppliedAt">
237- <value>(applied at $3)</value>
238- </entry>
239 </diagnostic>
240
241 <diagnostic code="XUTY0022">
242@@ -2892,6 +2888,10 @@
243 <value>already specified</value>
244 </entry>
245
246+ <entry key="AppliedAt">
247+ <value>applied at</value>
248+ </entry>
249+
250 <entry key="ArithOpNotDefinedBetween_23">
251 <value>arithmetic operation not defined between types "$2" and "$3"</value>
252 </entry>
253@@ -4049,7 +4049,6 @@
254 <value>: a sub-picture must contain at least one character that is an optional-digit-sign or a member of the decimal-digit-family</value>
255 </entry>
256
257-
258 <entry key="JSON_ILLEGAL_CHARACTER">
259 <value>'$2': illegal JSON character${ at 3}</value>
260 </entry>
261
262=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
263--- src/diagnostics/pregenerated/dict_en.cpp 2012-11-20 18:17:10 +0000
264+++ src/diagnostics/pregenerated/dict_en.cpp 2012-12-01 05:48:20 +0000
265@@ -514,6 +514,7 @@
266 { "~ANNOTATION", "annotation" },
267 { "~AllMatchesHasExcludes", "AllMatches contains StringExclude" },
268 { "~AlreadySpecified", "already specified" },
269+ { "~AppliedAt", "applied at" },
270 { "~ArithOpNotDefinedBetween_23", "arithmetic operation not defined between types \"$2\" and \"$3\"" },
271 { "~AtomizationHasMoreThanOneValue", "atomization has more than one value" },
272 { "~AttributeName", "attribute name" },
273@@ -889,7 +890,6 @@
274 { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" },
275 { "~XQST0106_CONFLICTING", "conflicting" },
276 { "~XQST0106_THE_SAME", "the same" },
277- { "~XUDY0021_AppliedAt", "(applied at $3)" },
278 { "~XUDY0021_AttributeName", "\"$3\": attribute with the same name already exists" },
279 { "~XUST0001_CONCAT", "comma expression with updating and non-updating branches" },
280 { "~XUST0001_Generic", "updating expression illegal here" },
281
282=== modified file 'src/diagnostics/pregenerated/dict_zed_keys.h'
283--- src/diagnostics/pregenerated/dict_zed_keys.h 2012-11-07 19:28:55 +0000
284+++ src/diagnostics/pregenerated/dict_zed_keys.h 2012-12-01 05:48:20 +0000
285@@ -53,7 +53,6 @@
286 #define ZED_XUST0001_IF "~XUST0001_IF"
287 #define ZED_XUST0001_UDF_2 "~XUST0001_UDF_2"
288 #define ZED_XUDY0021_AttributeName "~XUDY0021_AttributeName"
289-#define ZED_XUDY0021_AppliedAt "~XUDY0021_AppliedAt"
290 #define ZED_ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes "~ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes"
291 #define ZED_ZXQP0025_RESOURCE_NOT_FOUND "~ZXQP0025_RESOURCE_NOT_FOUND"
292 #define ZED_ZXQD0004_NON_NEGATIVE "~ZXQD0004_NON_NEGATIVE"
293@@ -79,6 +78,7 @@
294 #define ZED_ZWST0005_VARIADIC "~ZWST0005_VARIADIC"
295 #define ZED_AllMatchesHasExcludes "~AllMatchesHasExcludes"
296 #define ZED_AlreadySpecified "~AlreadySpecified"
297+#define ZED_AppliedAt "~AppliedAt"
298 #define ZED_ArithOpNotDefinedBetween_23 "~ArithOpNotDefinedBetween_23"
299 #define ZED_AtomizationHasMoreThanOneValue "~AtomizationHasMoreThanOneValue"
300 #define ZED_AttributeName "~AttributeName"
301
302=== modified file 'src/diagnostics/xquery_exception.cpp'
303--- src/diagnostics/xquery_exception.cpp 2012-09-19 21:16:15 +0000
304+++ src/diagnostics/xquery_exception.cpp 2012-12-01 05:48:20 +0000
305@@ -16,9 +16,14 @@
306
307 #include "stdafx.h"
308
309-#include <util/fs_util.h>
310-#include <util/uri_util.h>
311-
312+// standard
313+#include <cstring>
314+
315+// Zorba
316+#include "util/fs_util.h"
317+#include "util/uri_util.h"
318+
319+// local
320 #include "dict.h"
321 #include "xquery_exception.h"
322
323@@ -72,11 +77,21 @@
324 return unique_ptr<ZorbaException>( new XQueryException( *this ) );
325 }
326
327+void XQueryException::set_applied( char const *uri,
328+ line_type line,
329+ column_type col,
330+ line_type line_end,
331+ column_type col_end ) {
332+ if ( !uri || !*uri )
333+ uri = source_loc_.file();
334+ applied_loc_.set( uri, line, col, line_end, col_end );
335+}
336+
337 void XQueryException::set_source( char const *uri,
338 line_type line,
339 column_type col,
340 line_type line_end,
341- column_type col_end) {
342+ column_type col_end ) {
343 source_loc_.set( uri, line, col, line_end, col_end );
344 }
345
346@@ -84,36 +99,48 @@
347 throw *this;
348 }
349
350+static bool print_uri( ostream &o, char const *uri ) {
351+ if ( uri && *uri ) {
352+ switch ( uri::get_scheme( uri ) ) {
353+ case uri::none:
354+ case uri::file:
355+ try {
356+ o << '<' << fs::get_normalized_path( uri ) << '>';
357+ break;
358+ }
359+ catch ( ... ) {
360+ // fall back to printing as a URI
361+ }
362+ // no break;
363+ default:
364+ o << '<' << uri << '>';
365+ }
366+ return true;
367+ }
368+ return false;
369+}
370+
371 ostream& XQueryException::print( ostream &o ) const {
372 if ( has_source() ) {
373+ if ( !print_uri( o, source_uri() ) )
374+ o << '(' << diagnostic::dict::lookup( ZED( NoSourceURI ) ) << ')';
375+ o << ':' << source_line();
376+ if ( source_column() )
377+ o << ',' << source_column();
378
379- char const *const u = source_uri();
380- if ( u && *u ) {
381- switch ( uri::get_scheme( u ) ) {
382- case uri::none:
383- case uri::file:
384- try {
385- o << '<' << fs::get_normalized_path( u ) << '>';
386- break;
387- }
388- catch ( ... ) {
389- // fall back to printing as a URI
390- }
391- // no break;
392- default:
393- o << '<' << u << '>';
394+ if ( has_applied() ) {
395+ o << " (" << diagnostic::dict::lookup( ZED( AppliedAt ) ) << ' ';
396+ if ( applied_uri() && ::strcmp( applied_uri(), source_uri() ) != 0 ) {
397+ if ( print_uri( o, applied_uri() ) )
398+ o << ':';
399 }
400- } else
401- o << '(' << diagnostic::dict::lookup( ZED( NoSourceURI ) ) << ')';
402-
403- if ( source_line() ) {
404- o << ':' << source_line();
405- if ( source_column() )
406- o << ',' << source_column();
407- o << ':';
408+ o << applied_line();
409+ if ( applied_column() )
410+ o << ',' << applied_column();
411+ o << ')';
412 }
413
414- o << ' ';
415+ o << ": ";
416 }
417 return ZorbaException::print( o );
418 }
419@@ -131,11 +158,8 @@
420 XQueryException xe( diagnostic, raise_file, raise_line, message.c_str() );
421 if ( loc )
422 xe.set_source(
423- loc.file(),
424- loc.line(),
425- loc.column(),
426- loc.line_end(),
427- loc.column_end() );
428+ loc.file(), loc.line(), loc.column(), loc.line_end(), loc.column_end()
429+ );
430 return xe;
431 }
432
433@@ -151,14 +175,29 @@
434 new XQueryException( diagnostic, raise_file, raise_line, message.c_str() );
435 if ( loc )
436 xe->set_source(
437- loc.file(),
438- loc.line(),
439- loc.column(),
440- loc.line_end(),
441- loc.column_end() );
442+ loc.file(), loc.line(), loc.column(), loc.line_end(), loc.column_end()
443+ );
444 return xe;
445 }
446
447+void set_applied( ZorbaException &ze, char const *file,
448+ XQueryException::line_type line,
449+ XQueryException::column_type col,
450+ XQueryException::line_type line_end,
451+ XQueryException::column_type col_end,
452+ bool overwrite ) {
453+ if ( XQueryException *const xe = dynamic_cast<XQueryException*>( &ze ) ) {
454+ if ( !xe->has_applied() || overwrite )
455+ xe->set_applied( file, line, col, line_end, col_end );
456+ } else {
457+ XQueryException new_xe(
458+ ze.diagnostic(), ze.raise_file(), ze.raise_line(), ze.what()
459+ );
460+ new_xe.set_applied( file, line, col, line_end, col_end );
461+ throw new_xe;
462+ }
463+}
464+
465 void set_source( ZorbaException &ze, char const *file,
466 XQueryException::line_type line,
467 XQueryException::column_type col,
468
469=== modified file 'src/diagnostics/xquery_exception.h'
470--- src/diagnostics/xquery_exception.h 2012-09-19 21:16:15 +0000
471+++ src/diagnostics/xquery_exception.h 2012-12-01 05:48:20 +0000
472@@ -232,6 +232,106 @@
473 }
474 }
475
476+////////// XQuery diagnostic "applied at" location ////////////////////////////
477+
478+/**
479+ * Sets the XQuery source location of the given ZorbaException but only if it's
480+ * actually an XQueryException. If it's actually a ZorbaException, constructs
481+ * a new XQueryException (copying the information from the ZorbaException) and
482+ * throws it.
483+ *
484+ * @param ze The ZorbaException to set the location of.
485+ * @param file The XQuery file name.
486+ * @param line The line number.
487+ * @param col The column number.
488+ * @param line_end The end line number.
489+ * @param col_end The end column number.
490+ * @param overwrite If \c false, sets the location only if the exception
491+ * doesn't already have one; if \c true, always sets the location even if the
492+ * exception already has one.
493+ */
494+void set_applied( ZorbaException &ze, char const *file,
495+ XQueryException::line_type line,
496+ XQueryException::column_type col,
497+ XQueryException::line_type line_end,
498+ XQueryException::column_type col_end,
499+ bool overwrite = true );
500+
501+/**
502+ * Sets the XQuery source location of the given ZorbaException but only if it's
503+ * actually an XQueryException.
504+ *
505+ * @tparam StringType The \a file string type.
506+ * @param ze The ZorbaException to set the location of.
507+ * @param file The XQuery file name.
508+ * @param line The line number.
509+ * @param col The column number.
510+ * @param line_end The end line number.
511+ * @param col_end The end column number.
512+ * @param overwrite If \c false, sets the location only if the exception
513+ * doesn't already have one; if \c true, always sets the location even if the
514+ * exception already has one.
515+ */
516+template<class StringType> inline
517+void set_applied( ZorbaException &ze, StringType const &file,
518+ XQueryException::line_type line,
519+ XQueryException::column_type col,
520+ XQueryException::line_type line_end,
521+ XQueryException::column_type col_end,
522+ bool overwrite = true ) {
523+ set_applied( ze, file.c_str(), line, col, line_end, col_end, overwrite );
524+}
525+
526+/**
527+ * Sets the XQuery source location of the given ZorbaException but only if it's
528+ * actually an XQueryException.
529+ *
530+ * @param ze The ZorbaException to set the location of.
531+ * @param loc The query location.
532+ * @param overwrite If \c false, sets the location only if the exception
533+ * doesn't already have one; if \c true, always sets the location even if the
534+ * exception already has one.
535+ */
536+inline void set_applied( ZorbaException &ze, QueryLoc const &loc,
537+ bool overwrite = true ) {
538+ set_applied(
539+ ze,
540+ loc.getFilename(),
541+ loc.getLineBegin(),
542+ loc.getColumnBegin(),
543+ loc.getLineEnd(),
544+ loc.getColumnEnd(),
545+ overwrite
546+ );
547+}
548+
549+/**
550+ * Sets the XQuery source location of the given ZorbaException but only if it's
551+ * actually an XQueryException.
552+ *
553+ * @param to The ZorbaException to set the location of.
554+ * @param from The ZorbaException to get the location from but only if it's
555+ * actually an XQueryException.
556+ * @param overwrite If \c false, sets the location only if the exception
557+ * doesn't already have one; if \c true, always sets the location even if the
558+ * exception already has one.
559+ */
560+inline void set_applied( ZorbaException &to, ZorbaException const &from,
561+ bool overwrite = true ) {
562+ if ( XQueryException const *const xe =
563+ dynamic_cast<XQueryException const*>( &from ) ) {
564+ set_applied(
565+ to,
566+ xe->source_uri(),
567+ xe->source_line(),
568+ xe->source_column(),
569+ xe->source_line_end(),
570+ xe->source_column_end(),
571+ overwrite
572+ );
573+ }
574+}
575+
576 ///////////////////////////////////////////////////////////////////////////////
577
578 } // namespace zorba
579
580=== modified file 'src/runtime/core/apply_updates.cpp'
581--- src/runtime/core/apply_updates.cpp 2012-11-26 15:39:32 +0000
582+++ src/runtime/core/apply_updates.cpp 2012-12-01 05:48:20 +0000
583@@ -235,45 +235,9 @@
584 catch (XQueryException& e)
585 {
586 if ( e.has_source() )
587- {
588- Diagnostic const &d = e.diagnostic();
589- if ( d == err::XUDY0021
590- || d == err::XUDY0024
591- || d == jerr::JNUP0006
592- || d == zerr::ZDDY0013_COLLECTION_BAD_DESTROY_INDEXES
593- || d == zerr::ZDDY0014_COLLECTION_BAD_DESTROY_ICS
594- || d == zerr::ZDDY0015_COLLECTION_BAD_DESTROY_NODES
595- || d == zerr::ZDDY0028_INDEX_DOMAIN_HAS_DUPLICATE_NODES
596- || d == zerr::ZDDY0023_INDEX_DOES_NOT_EXIST
597- || d == zerr::ZSTR0060_RANGE_EXCEPTION )
598- {
599- try {
600- QueryLoc loc2( loc );
601- loc2.setFilename( fs::base_name( loc.getFilename() ) );
602- throw XQUERY_EXCEPTION(
603- err::XUDY0021,
604- ERROR_PARAMS( e.what(), ZED( XUDY0021_AppliedAt ), loc2 ),
605- ERROR_LOC( e )
606- );
607- }
608- catch ( XQueryException &e2 ) {
609- //
610- // This extra try/catch is used so that we can use the error
611- // dictionary value string of XUDY0021 to format the error message,
612- // but then set the actual error code back to that of the original
613- // exception.
614- //
615- e2.set_diagnostic( d );
616- throw;
617- }
618- }
619- }
620+ set_applied( e, loc );
621 else
622- {
623- // exception raised by the store doesn't have a store location
624- // hence, we add the location of the apply expression
625- set_source(e, loc);
626- }
627+ set_source( e, loc );
628 throw;
629 }
630 }
631
632=== modified file 'test/rbkt/ExpQueryResults/zorba/index/undo1.xml.res'
633--- test/rbkt/ExpQueryResults/zorba/index/undo1.xml.res 2012-11-26 04:14:28 +0000
634+++ test/rbkt/ExpQueryResults/zorba/index/undo1.xml.res 2012-12-01 05:48:20 +0000
635@@ -3,7 +3,7 @@
636 First probing for Amsterdam:
637 <person id="person6"><name>Bassem Nagasaki</name></person>
638
639-<exception>zerr:ZDDY0013 : "auctions:auctions": can not delete collection because indexes reference it (applied at undo1.xq:48.9-39)</exception>
640+<exception>zerr:ZDDY0013 : "auctions:auctions": can not delete collection because indexes reference it</exception>
641
642 Second probing for Amsterdam
643 <person id="person6"><name>Bassem Nagasaki</name></person>
644
645=== modified file 'test/rbkt/Queries/zorba/index/auctions2u.xq'
646--- test/rbkt/Queries/zorba/index/auctions2u.xq 2012-09-20 21:35:17 +0000
647+++ test/rbkt/Queries/zorba/index/auctions2u.xq 2012-12-01 05:48:20 +0000
648@@ -162,7 +162,7 @@
649 }}
650 catch *
651 {
652- <exception>{$err:code} : {substring-before($err:description, " (applied")}</exception>
653+ <exception>{$err:code} : { $err:description }</exception>
654 }
655 ,
656 for $x in auctions:probe-point-watch($auctions:PersonWatches,
657
658=== modified file 'test/rbkt/Queries/zorba/index/undo1.xq'
659--- test/rbkt/Queries/zorba/index/undo1.xq 2012-11-26 04:14:28 +0000
660+++ test/rbkt/Queries/zorba/index/undo1.xq 2012-12-01 05:48:20 +0000
661@@ -57,10 +57,7 @@
662 }
663 catch *
664 {
665- let $msg1 := substring-before($err:description, " (applied")
666- let $msg2 := substring-after($err:description, "undo1.xq")
667- let $msg3 := concat($msg1, " (applied at undo1.xq", $msg2)
668- return <exception>{ $err:code } : { $msg3 }</exception>
669+ <exception>{ $err:code } : { $err:description }</exception>
670 }
671
672 ,

Subscribers

People subscribed via source and target branches