Prevents stack level too deep error

If a database option was incorrectly set the error handling was causing a `stack level too deep` exception.