blueveinz
May 25th, 2009, 06:13 AM
Hello,
Does anyone have an example of how to use custom exception translation in Spring-Blazeds?
I have declared my bean as followed:
<flex:message-broker id="_messageBroker">
<flex:exception-translator ref="exceptionTranslator" />
</flex:message-broker>
<flex:message-destination id="messagingDestination" message-broker="_messageBroker" />
<bean id="exceptionTranslator" class="exceptions.MyExceptionTranslator" />
import org.springframework.flex.core.ExceptionTranslator;
import flex.messaging.MessageException;
public class MyExceptionTranslator implements ExceptionTranslator {
public boolean handles(Class<?> arg0) {
return true;
}
public MessageException translate(Throwable t) {
MessageException me = new MessageException();
//blabla
throw me;
}
But when an exception occures (I catch exceptions and throw them further) I never get into MyExceptionTranslator..
What am I doing wrong?
Does anyone have an example of how to use custom exception translation in Spring-Blazeds?
I have declared my bean as followed:
<flex:message-broker id="_messageBroker">
<flex:exception-translator ref="exceptionTranslator" />
</flex:message-broker>
<flex:message-destination id="messagingDestination" message-broker="_messageBroker" />
<bean id="exceptionTranslator" class="exceptions.MyExceptionTranslator" />
import org.springframework.flex.core.ExceptionTranslator;
import flex.messaging.MessageException;
public class MyExceptionTranslator implements ExceptionTranslator {
public boolean handles(Class<?> arg0) {
return true;
}
public MessageException translate(Throwable t) {
MessageException me = new MessageException();
//blabla
throw me;
}
But when an exception occures (I catch exceptions and throw them further) I never get into MyExceptionTranslator..
What am I doing wrong?