Handle IntegrityError exception