I don't like this. Having the database throw an error is a horrible way to do checking and makes it way too easy to hide actual errors. If it's just for one use case, make that case behave differently.

At the very least, this shouldn't be a generic Exception.