Am Don, 2003-02-13 um 19.17 schrieb Jeroen Cranendonk: > > Am Don, 2003-02-13 um 17.20 schrieb Jeroen Cranendonk: > > > Our company is currently building a project around cocoon(yay:) and > xmlforms. > > > We are using the current development cvs version. > > > Working on this it occured to me that the prepare and perform methods of > > > the AbstractXMLFormAction class don't allow the throwing of any > exceptions > > > whatsoever. > > > My question is if this is by design or by error, and how I should handle > any > > > errors occuring in my implementations of prepare and perform. > > > (And if this is by error and not design, if anyone feels like fixin it > soon > > > ^.^ ) > > > > you mean the perform( ) method does not declare a checked exception? > I mean AbstractXMLFormAction.java says : > perform(); > and not > perform() throws someExceptions;
jup. > > first: > > you can use the following trick to throw always an exception > > > > try { > > > > } catch ( Throwable t ) { > > throw new RuntimeException( t ) ; > > } > > > > this works, since RuntimeException and subclasses don't need to occur in > > the signature. > Sounds good, I'll try that :) > will this still be cought more upwards by cocoon tho, so it can generate a > cocoon > error page ? (using <map:handle-errors>, that's what I want really ) > sure ase RuntimeException extends Exception, so if you do catch ( Exception e ) { } you also get RuntimeExceptions like NullPointerException and things like that ... -- Jakob --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]