Merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

Proposed by Till Westmann
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/bug-1009366
Merge into: lp:zorba
Diff against target: 66 lines (+25/-9)
2 files modified
src/compiler/translator/translator.cpp (+18/-7)
test/api/userdefined_uri_resolution.cpp (+7/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1009366
Reviewer Review Type Date Requested Status
Chris Hillery Pending
Markos Zaharioudakis Pending
Review via email: mp+108894@code.launchpad.net

This proposal has been superseded by a proposal from 2012-06-14.

Description of the change

add location information to ZXQP0029_URI_ACCESS_DENIED

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

It is better (more robust) if the catch in translator.cpp catches ZorbaException instead of XQueryException.

lp:~zorba-coders/zorba/bug-1009366 updated
10868. By Paul J. Lucas

s/ZORBA_ASSERT/if/ Approved: Matthias Brantner, Paul J. Lucas

10869. By Paul J. Lucas

1. Fixed return type of ft:thesaurus-lookup().
2. Added a test to ensure that a look-up of a non-existant word works. Approved: Matthias Brantner, Paul J. Lucas

Revision history for this message
Chris Hillery (ceejatec) wrote :

Please add the "correct exception" message back in test_userdefined_uri_resolvers, so that it is clear when the test passes. Also, as it is, if the test fails you will report the exception twice; that's probably not necessary.

Other than that and Markos' comment, looks fine.

lp:~zorba-coders/zorba/bug-1009366 updated
10870. By Rodolfo Ochoa

- Install added for XQJ bindings and documentation
- more documentation for all SWIG generated language bindings
- other installer related cleanups Approved: Matthias Brantner, Chris Hillery, Juan Zacarias

10871. By Markos Zaharioudakis

fixed bug #1006166 Approved: Markos Zaharioudakis

10872. By Markos Zaharioudakis

fixed bug 960083$ (improper error handling of NaN comparisons) + small optimization of comparison operations Approved: Markos Zaharioudakis

10873. By Carlos Manuel Lopez

Implements new group by syntax, as defined in the XQuery 3.0 Spec since September 2011 Approved: Markos Zaharioudakis

10874. By Markos Zaharioudakis

Fixed bug #1003023$ (optimizer problems due to common subexpression after var folding into if-then-else) Approved: Markos Zaharioudakis

10875. By Markos Zaharioudakis

fixed bug #854506 and partial fix for bug #867008 Approved: Markos Zaharioudakis

10876. By Markos Zaharioudakis

Improved hoist rule: tighter hoisting of expressions (also fixes bug #967428) Approved: Markos Zaharioudakis

10877. By Markos Zaharioudakis

Fixed bug #991088$ (raise XUST0001 in trycatch with mixed updating and simple clauses)
 Approved: Markos Zaharioudakis

10878. By Till Westmann

add location information to ZXQP0029_URI_ACCESS_DENIED

Revision history for this message
Till Westmann (tillw) wrote :

I've changed the catch(...) in translator.cpp and I've put the "correct exception" message back into the test.
However, I don't see why the exception is reported twice, if the test fails.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp 2012-06-14 15:20:15 +0000
+++ src/compiler/translator/translator.cpp 2012-06-14 20:32:20 +0000
@@ -2967,13 +2967,24 @@
2967 // rather than using compURI directly, because we want the version2967 // rather than using compURI directly, because we want the version
2968 // fragment to be passed to the mappers.2968 // fragment to be passed to the mappers.
2969 zstring lErrorMessage;2969 zstring lErrorMessage;
2970 std::auto_ptr<internal::Resource> lResource =2970 std::auto_ptr<internal::Resource> lResource;
2971 theSctx->resolve_uri(compModVer.versioned_uri(),2971 internal::StreamResource* lStreamResource = NULL;
2972 internal::EntityData::MODULE,2972
2973 lErrorMessage);2973 try
29742974 {
2975 internal::StreamResource* lStreamResource =2975 lResource =
2976 dynamic_cast<internal::StreamResource*> (lResource.get());2976 theSctx->resolve_uri(compModVer.versioned_uri(),
2977 internal::EntityData::MODULE,
2978 lErrorMessage);
2979
2980 lStreamResource =
2981 dynamic_cast<internal::StreamResource*> (lResource.get());
2982 }
2983 catch (ZorbaException& e)
2984 {
2985 set_source(e, loc);
2986 throw;
2987 }
29772988
2978 if (lStreamResource != NULL)2989 if (lStreamResource != NULL)
2979 {2990 {
29802991
=== modified file 'test/api/userdefined_uri_resolution.cpp'
--- test/api/userdefined_uri_resolution.cpp 2012-06-14 15:20:15 +0000
+++ test/api/userdefined_uri_resolution.cpp 2012-06-14 20:32:20 +0000
@@ -21,6 +21,7 @@
21#include <zorba/zorba.h>21#include <zorba/zorba.h>
22#include <zorba/store_manager.h>22#include <zorba/store_manager.h>
23#include <zorba/zorba_exception.h>23#include <zorba/zorba_exception.h>
24#include <zorba/xquery_exception.h>
24#include <zorba/uri_resolvers.h>25#include <zorba/uri_resolvers.h>
25#include <zorba/diagnostic_list.h>26#include <zorba/diagnostic_list.h>
2627
@@ -297,12 +298,16 @@
297 "'http://expath.org/ns/file'; "298 "'http://expath.org/ns/file'; "
298 "1 + 1", lContext);299 "1 + 1", lContext);
299 std::cout << lQuery << std::endl;300 std::cout << lQuery << std::endl;
300 } catch (ZorbaException& e) {301 } catch (XQueryException& e) {
301 std::cout << "Caught exception: " << e.what() << std::endl;302 std::cout << "Caught exception: " << e.what() << std::endl;
302 if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED) {303 if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED
304 && e.has_source()
305 && e.source_line() == 1) {
303 std::cout << "...the correct exception!" << std::endl;306 std::cout << "...the correct exception!" << std::endl;
304 return true;307 return true;
305 }308 }
309 } catch (ZorbaException& e) {
310 std::cout << "Caught unexpected exception: " << e.what() << std::endl;
306 }311 }
307 return false;312 return false;
308}313}

Subscribers

People subscribed via source and target branches