[DuplicateAttribute] Add a constructor for error duplicate.