better exception switch for db connect errors