No you can only refer to the exception and define it as a <bean>

On Thu, Apr 24, 2014 at 3:58 PM, Minh Tran <[email protected]> wrote:
> Hi
>
> It appears the only way to throw exceptions in the spring DSL is to declare 
> the exception as a bean and use the <throwException> tag with the reference 
> to the bean. However doing so means you're limited to whatever message you 
> declared your bean with. e.g.
>
> <bean id="myException" class="java.lang.RuntimeException">
>         <constructor-arg>something bad happened</constructor-arg>
> </bean>
>
> So is it possible to throw an exception with a customised message? Or is this 
> just a limitation of spring DSL? Would be awesome if I could do something 
> like this
>
> <throwException>
>         <bean class="java.lang.RuntimeException">
>                 <constructor-arg>my message</constructor-arg>
>         </bean>
> </throwException>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to