[Platemail-developer] exception handling
Status: Pre-Alpha
Brought to you by:
batneil
|
From: David S. <ds...@in...> - 2005-03-16 01:13:11
|
Neil, What'd you think the best exception handling policy is? I see you've created a PlatemailException class, which I've extended to create a RegistryException class, however I'm not sure on the best approach. As I see it, I (currently) want to have an exception that can be thrown when the save/load process fails. The best behavior here is to have the exception pass all the way back to the kernel, which can then perform a controlled shutdown. I'm looking to "fail early" here, which I think is the best idea generally, however I don't think that a subsystem should do a System.exit() call. Another question is how many such exceptions I should create; one for each type of failure? Should I do something like this: SaveException extends RegistryException extends PlatemailException LoadException extends RegistryException extends PlatemailException or, should I just have one RegistryException and pass it a string specifying the error, which I presume is passed up for java.lang.Exception to handle. I'm leaning toward having an separate exceptions for everything, not just things that you might want to differentiate between, though that could conceivably be a lot of options. What'd you think? dgs. |