The current attributeDuplicate error is misleading:
✅ in the case of verified/declared attribute creation it is thrown when an attribute with the same name already exists, with the message: ApiError during Attribute creation with name ${attributeName}
❌ in the case of certified attribute creation, the error is thrown only when an attribute with the same name and code already exists, but the error message is the same
Fix in this PR:
I created a dedicated error for the second case, with a more meaningful message
I also improved the tests to check that the check on the names is case insensitive
The code for both errors is still the same, so that the error mappers still work as expected
Closes IMN-784
Before this PR
The current
attributeDuplicate
error is misleading:✅ in the case of verified/declared attribute creation it is thrown when an attribute with the same name already exists, with the message:
ApiError during Attribute creation with name ${attributeName}
❌ in the case of certified attribute creation, the error is thrown only when an attribute with the same name and code already exists, but the error message is the same
Fix in this PR: