Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Till Westmann
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.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/108894
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Till Westmann
Till Westmann has proposed merging lp:~zorba-coders/zorba/bug-1009366 into 
lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)
  Chris Hillery (ceejatec)
Related bugs:
  Bug #1009366 in Zorba: access denied error message for module URIs does not 
contain location information
  https://bugs.launchpad.net/zorba/+bug/1009366

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410

add location information to ZXQP0029_URI_ACCESS_DENIED
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-06-14 15:20:15 +
+++ src/compiler/translator/translator.cpp	2012-06-14 20:36:35 +
@@ -2967,13 +2967,24 @@
   // rather than using compURI directly, because we want the version
   // fragment to be passed to the mappers.
   zstring lErrorMessage;
-  std::auto_ptrinternal::Resource lResource =
-  theSctx-resolve_uri(compModVer.versioned_uri(),
-   internal::EntityData::MODULE,
-   lErrorMessage);
-
-  internal::StreamResource* lStreamResource =
-  dynamic_castinternal::StreamResource* (lResource.get());
+  std::auto_ptrinternal::Resource lResource;
+  internal::StreamResource* lStreamResource = NULL;
+
+  try
+  {
+lResource =
+theSctx-resolve_uri(compModVer.versioned_uri(),
+ internal::EntityData::MODULE,
+ lErrorMessage);
+
+lStreamResource =
+dynamic_castinternal::StreamResource* (lResource.get());
+  }
+  catch (ZorbaException e)
+  {
+set_source(e, loc);
+throw;
+  }
 
   if (lStreamResource != NULL)
   {

=== modified file 'test/api/userdefined_uri_resolution.cpp'
--- test/api/userdefined_uri_resolution.cpp	2012-06-14 15:20:15 +
+++ test/api/userdefined_uri_resolution.cpp	2012-06-14 20:36:35 +
@@ -21,6 +21,7 @@
 #include zorba/zorba.h
 #include zorba/store_manager.h
 #include zorba/zorba_exception.h
+#include zorba/xquery_exception.h
 #include zorba/uri_resolvers.h
 #include zorba/diagnostic_list.h
 
@@ -297,12 +298,16 @@
 'http://expath.org/ns/file'; 
 1 + 1, lContext);
 std::cout  lQuery  std::endl;
-  } catch (ZorbaException e) {
+  } catch (XQueryException e) {
 std::cout  Caught exception:   e.what()  std::endl;
-if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED) {
+if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED
+ e.has_source()
+ e.source_line() == 1) {
   std::cout  ...the correct exception!  std::endl;
   return true;
 }
+  } catch (ZorbaException e) {
+std::cout  Caught unexpected exception:   e.what()  std::endl;
   }
   return false;
 }

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Till Westmann
The proposal to merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba has been 
updated.

Commit Message changed to:

add location information to ZXQP0029_URI_ACCESS_DENIED

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Till Westmann
The proposal to merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug-1009366-2012-06-14T20-56-11.007Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
Validation queue job bug-1009366-2012-06-14T20-56-11.007Z is finished. The 
final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
Voting does not meet specified criteria. Required: Approve  1, Disapprove  1, 
Needs Fixing  1, Pending  1. Got: 2 Approve, 1 Pending.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
The proposal to merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba has been 
updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Chris Hillery
Review: Approve

I think I mis-read the diff last time when I mentioned the double output of 
exceptions (I didn't see it as two separate catch() clauses). Latest changes 
look fine.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Chris Hillery
The proposal to merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba has been 
updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/bug-1009366-2012-06-14T23-40-03.247Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread Zorba Build Bot
Validation queue job bug-1009366-2012-06-14T23-40-03.247Z is finished. The 
final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-14 Thread noreply
The proposal to merge lp:~zorba-coders/zorba/bug-1009366 into lp:zorba has been 
updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/110410
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-09 Thread Chris Hillery
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.
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/108894
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/bug-1009366 into lp:zorba

2012-06-06 Thread Till Westmann
Till Westmann has proposed merging lp:~zorba-coders/zorba/bug-1009366 into 
lp:zorba.

Requested reviews:
  Chris Hillery (ceejatec)
  Markos Zaharioudakis (markos-za)
Related bugs:
  Bug #1009366 in Zorba: access denied error message for module URIs does not 
contain location information
  https://bugs.launchpad.net/zorba/+bug/1009366

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/108894

add location information to ZXQP0029_URI_ACCESS_DENIED
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1009366/+merge/108894
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-05-09 23:06:41 +
+++ src/compiler/translator/translator.cpp	2012-06-06 08:01:24 +
@@ -2955,13 +2955,24 @@
   // rather than using compURI directly, because we want the version
   // fragment to be passed to the mappers.
   zstring lErrorMessage;
-  std::auto_ptrinternal::Resource lResource =
-  theSctx-resolve_uri(compModVer.versioned_uri(),
-   internal::EntityData::MODULE,
-   lErrorMessage);
-
-  internal::StreamResource* lStreamResource =
-  dynamic_castinternal::StreamResource* (lResource.get());
+  std::auto_ptrinternal::Resource lResource;
+  internal::StreamResource* lStreamResource = NULL;
+
+  try
+  {
+lResource =
+theSctx-resolve_uri(compModVer.versioned_uri(),
+ internal::EntityData::MODULE,
+ lErrorMessage);
+
+lStreamResource =
+dynamic_castinternal::StreamResource* (lResource.get());
+  }
+  catch (XQueryException e)
+  {
+set_source(e, loc);
+throw;
+  }
 
   if (lStreamResource != NULL)
   {

=== modified file 'test/api/userdefined_uri_resolution.cpp'
--- test/api/userdefined_uri_resolution.cpp	2012-05-05 02:39:12 +
+++ test/api/userdefined_uri_resolution.cpp	2012-06-06 08:01:24 +
@@ -21,6 +21,7 @@
 #include zorba/zorba.h
 #include zorba/store_manager.h
 #include zorba/zorba_exception.h
+#include zorba/xquery_exception.h
 #include zorba/uri_resolvers.h
 #include zorba/diagnostic_list.h
 
@@ -297,12 +298,15 @@
 'http://expath.org/ns/file'; 
 1 + 1, lContext);
 std::cout  lQuery  std::endl;
-  } catch (ZorbaException e) {
+  } catch (XQueryException e) {
 std::cout  Caught exception:   e.what()  std::endl;
-if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED) {
-  std::cout  ...the correct exception!  std::endl;
+if (e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED
+ e.has_source()
+ e.source_line() == 1) {
   return true;
 }
+  } catch (ZorbaException e) {
+std::cout  Caught unexpected exception:   e.what()  std::endl;
   }
   return false;
 }

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp