improved consistency in exception messages when database errors occur