I was working on this function which was quite specific to my project, so thought I'd make it more generic and share it, since I could find very little on the subject in my searching.
Code also demonstartes how exceptions can work to your advantage when you know they are going to be thrown.
I'm really quite new to OOP, so maybe I have no business posting snippets, but I quite enjoyed writing this one so I'll post it anyway :-)
Any comments, criticisms or improvements are very welcome.