Merge lp:~zorba-coders/zorba/xqdoc_exception_handling into lp:zorba

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Sorin Marian Nasoi
Approved revision: 10773
Merged at revision: 10795
Proposed branch: lp:~zorba-coders/zorba/xqdoc_exception_handling
Merge into: lp:zorba
Diff against target: 36 lines (+12/-1)
1 file modified
modules/com/zorba-xquery/www/modules/project_xqdoc.xq (+12/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/xqdoc_exception_handling
Reviewer Review Type Date Requested Status
William Candillon Approve
Sorin Marian Nasoi Approve
Review via email: mp+102496@code.launchpad.net

Commit message

Added try/catch for errors in the module processing.

Description of the change

Added try/catch for errors in the module processing.

To post a comment you must log in.
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
William Candillon (wcandillon) :
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 xqdoc_exception_handling-2012-04-24T20-55-13.173Z 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 'modules/com/zorba-xquery/www/modules/project_xqdoc.xq'
2--- modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-16 20:56:43 +0000
3+++ modules/com/zorba-xquery/www/modules/project_xqdoc.xq 2012-04-18 11:36:52 +0000
4@@ -112,13 +112,15 @@
5 if(count($moduleManifests) eq xs:integer(0)) then ();
6 else
7 {
8+ try
9+ {
10 for $module in $moduleManifests
11 (: note the module version is not supported because of a bug in the fetch for the module URI ending with / :)
12 (:let $moduleURI := if(ends-with(data($module/zm:uri),'/')) then data($module/zm:uri)
13 else if(exists($module/@version)) then concat(data($module/zm:uri),"#",data($module/@version))
14 else data($module/zm:uri):)
15 (:let $moduleFetched := fetch:content(trace($moduleURI,"fetch module URI version.."), "MODULE"):)
16- let $moduleURI := if(ends-with(data($module/zm:uri),".xq")) then substring-before(data($module/zm:uri),".xq") else data($module/zm:uri)
17+ let $moduleURI := data($module/zm:uri)
18 let $moduleFetched := fetch:content($moduleURI, "MODULE")
19 let $xqdoc := xqd:xqdoc-content($moduleFetched)
20 let $xqdocRelFileName := pxqdoc:get-filename($moduleURI)
21@@ -127,6 +129,15 @@
22 file:write($xqdocFileName,
23 $xqdoc,
24 $pxqdoc:serParamXml)
25+ }
26+ catch *
27+ {
28+ fn:error($err:UE004,
29+ concat("Error processing module ",
30+ $werr:code,
31+ " - ",
32+ $werr:description))
33+ }
34 };
35 }
36 };

Subscribers

People subscribed via source and target branches