On 12.Apr.2002 -- 09:18 AM, Jerzy Kut wrote:
> Hi cocooners!
> I want to handle errors coming from esql selects and actions operate on DB.
> ESQL - I try to do:
> 
>    <esql:connection>
>     <esql:pool>mypool</esql:pool>
>     <esql:execute-query>
>      <esql:query>
>       select EMPNO
>       from EMP
>      </esql:query>
>      <esql:results>
>       <esql:row-results>
>        <employee>
>         <id>
>          <value><esql:get-long column="EMPNO"/></value>
>         </id>
>        </employee>
>       </esql:row-results>
>      </esql:results>
>      <esql:no-results>
>       <employee-lack/>
>      </esql:no-results>
>      <esql:error-results>
>       <employee-error><esql:get-message/></employee-error>
>      </esql:error-results>
>     </esql:execute-query>
>    </esql:connection>
> 
> and? When i make fail in select e.g. type "SELCET" not "SELECT" i get
> "Cocoon error" and cocoon error page! I have same when I define not exist
> DSN in DB connection at cocoon.xconf.
> Maybe anybody knows any howto document or the way what to handle this
> exceptions.
> I don't handle errors in sitemap.xmap (if it has any importance).
> 
> And second question: how to handle db error when I would to use
> Database*Action? Is any method to handle this error in sitemap.xmaps
> <pipeline> ?

IMHO error-results refers to errors returned by the database
system. Any setup error would not be catched and lead to a cocoon
error. As for the SQL syntax error -- errors during execution are not
handled in error-results (why?) but only exceptions that occur while
retrieving the results.

Database*Actions will also cause cocoon errors when connectivity is
broken. Other errors can be handled by nesting sitemap elements inside
your action for the success branch and those for failure after it. The
elements nested will only be considered for your pipeline if the
action signalles success.

HTH.

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to