On Mon, Jun 8, 2009 at 12:25 PM, Michael Ossareh<[email protected]> wrote:
> Hi,
>
> Firstly I'm cross posting because there is, in my mind at least, two
> discussions which can come out of this. If you feel your reply is only
> pertinent to one group please remove the other from your reply!
>
> I've uncovered what I believe to be a problem in the framework of
> MINA. I'm using 2.0.0-m5. As it currently stands any classes that
> subclass IoHandlerAdapter are crippled by the methods throwing
> Exception and the framework catching it. In my case I cannot write
> JUnit test cases because the Exception thrown by Assert.fail() is
> caught up in the framework therefore not allowing me to verify
> failures.
>
> Dev's Is there a strong reason for this? Exceptions need to take place
> in business logic, not just test cases, and right now they cannot.
> These methods, I feel, shouldn't have Exception in their method def.
> Perhaps a subclass of Exception such as BusinessException or something
> which we can treat differently?
>
> Perhaps I've missed something? Is there some part of the filter chain
> that you can add an exception handler? That only unhandled exceptions
> then result in bubbling to the top?
>
> Thoughts? Depending what we come up with I'm happy to implement a fix.


I've had some more time to digest my initial thoughts on this -
interested to know what you dev's think.

What is the result of an Exception being thrown at the IoHandler
level? This isn't documented; I appreciate why it is not documented.
The closest I can think of is spring's transaction management - when
you throw an exception it triggers a rollback. At this layer the
packet has already been read from the network, in my case it has
already been identified by the demux decodable method, so what benefit
is there to my exception being tracked here?

This is beyond the JUnit example I gave, this is more a 'spiritual'
thought regarding exception handling.



>
> Cheers,
>
> mike
>
>
> --
> god loves atheists, Fact: http://www.mrwiggleslovesyou.com/comics/rehab477.jpg
>



-- 
god loves atheists, Fact: http://www.mrwiggleslovesyou.com/comics/rehab477.jpg

Reply via email to