Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Exception propagation during file transfer

Hi,
I'm having some trouble understanding how to propagate exceptions during file transfer.

I have a IFileTransferListener implementation that listens to IIncomingFileTransferReceiveStartEvent. When encountered, it passes a File handle to my desired destination using the receive() method. This receive method in turn is declared with a throws IOException clause. My handleTransferEvent is not allowed to throw any exception at all.

Unless I want to handle the exception right there and then, my only option is to throw a RuntimeException. The exception can later be accessed from my IFileTransfer which is what I want, but why force the use of a RuntimeException?

I think that a more flexible approach would be to let the handleTransferEvent throw a CoreException and an IOException (since those two would cover most needs). An alternative would be to allow the InvocationTargetException but if that is used the IFileTransfer.getException() must be changed to return a Throwable.



Back to the top