Friendlier way of handling database errors