Add try/catch exception handler to database connection.