Database connection error handler