You have to be careful when throwing exceptions in a constructor, that is if you want clean running code. Constructors should also return valid objects but sometimes can't due to errors. I guess the best way to deal with something of this senario is present clear error messages that let the user know what they failed to give or present, and second is to use the finally clause. The finally clause will give about the only way to "clean up" your code after failure, although you must be careful here also. Using the finally clause means that it will execute every time the code is run(you know this already), which means some kind of flag must be created in order for proper cleanup.
Hope that makes a little sense and helps out some. I'm sure you know all of that already and are seeking more advanced techniques, but that's about the only path you can go down on.
Reputation Points: 113
Solved Threads: 19
Postaholic
Offline 2,108 posts
since Jun 2004