cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Textor" <jc.tex...@gmx.de>
Subject Re: Catching errors in flowscript
Date Thu, 13 Mar 2008 10:59:59 GMT
not sure where the "print" output ends up, though. I'd use

try {
   //do something stupid!   
} catch(err) {
   cocoon.log.error( err ); 
}

or, if you want it less verbose, 

try {
   //do something stupid!   
} catch(err) {
   cocoon.log.error( err.getMessage() ); 
}

In these cases the error will end up in one of the log files in WEB-INF/log, depending on
your version.

If you want to do it "the wrong way" and send the error directly to stdout: 

try {
   //do something stupid!   
} catch(err) {
  err.printStackTrace();
}

HTH,
Johannes

-------- Original-Nachricht --------
> Datum: Thu, 13 Mar 2008 12:15:55 +0200
> Von: Andre Juffer <Andre.Juffer@oulu.fi>
> An: users@cocoon.apache.org
> Betreff: Re: Catching errors in flowscript

> Derek Hohls wrote:
> > Using C2.1.8
> >  
> > If I have the following:
> >  
> >  try {
> >    //do something stupid!   
> >  } catch(err) {
> >   print ("Your error: "+err.description)
> >  }
> 
> err is an Java exception or a javascript Error, so err.message or 
> err.getMessage() should work.
> 
> >  
> > Then the print statement does not yield the error description;
> > is there some way of doing this?
> >  
> > Thanks
> > Derek
> > 
> > -- 
> > This message is subject to the CSIR's copyright terms and conditions, 
> > e-mail legal notice, and implemented Open Document Format (ODF)
> standard.
> > The full disclaimer details can be found at 
> > http://www.csir.co.za/disclaimer.html.
> > 
> > 
> > This message has been scanned for viruses and dangerous content by 
> > *MailScanner* <http://www.mailscanner.info/>,
> > and is believed to be clean. MailScanner thanks Transtec Computers 
> > <http://www.transtec.co.uk/> for their support.
> > 
> 
> 
> -- 
> Andre H. Juffer              | Phone: +358-8-553 1161
> The Biocenter and            | Fax: +358-8-553-1141
>      the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
> University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
> NordProt                     | WWW: www.nordprot.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message