Michael Stahl schrieb:

hi,

i've got an interface to load an arbitrary number of files, where each load operation may fail independently, but any failure should not abort the whole operation. so i'd like to throw some kind of compound exception at the end if at least 1 error occurred.


That seems backwards.

If a single failure means that the entire operation is considered failed, you should abort with that single exception as soon as the error occurs. If possible roll back the things you already did first.

If failure of a suboperation is NOT a failure of the entire operation, then this should be treated as a qualified success. That means it shouldn't throw, but return, possibly passing out a tally of what worked and failed. So returning a collection of objects that describes the status of each suboperation (possibly including the exception object you caught) would seem to be the more appropriate solution.

- Jörg


--
Joerg Barfurth           phone: +49 40 23646662 / x66662
Software Engineer        mailto:[email protected]
Desktop Technology       http://reserv.ireland/twiki/bin/view/Argus/
Thin Client Software     http://www.sun.com/software/sunray/
Sun Microsystems GmbH    http://www.sun.com/software/javadesktopsystem/



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to