Better db err code handling