Adjusted error logging on database connection error to make sure it gets logged