How to throw RejectLogon from onMessage?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to throw RejectLogon from onMessage?

klyinliu
This post has NOT been accepted by the mailing list yet.
According to the most type safe suggestion, I should use the cracker for the logon message I recieved. But I got into problem as I would like to check the username and password in the message and when they doesn't match, I need to throw the RejectLogon exception.

I can see there is no problem throwing the RejectLogon in fromAdmin function. However, if I use the message cracker as suggested. I only have this signature:
    public void onMessage(Logon message, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue
And it doesn't allow to throw the RejectLogon exception. Any idea why? And any way to walk around?

Thanks.