#2869 Unfriendly error message.
Closed: Fixed None Opened 11 years ago by edewata.

The error message for adding invalid trust type is not very user friendly:

% ipa trust-add ad.test --type=asdf
ipa: ERROR: invalid 'type': must be one of (u'ad',)

The code raises a ValidationError with a message 'only "ad" is supported' but it doesn't appear in the error message above.

Alexander's note:

The message above comes from StrEnum() validator which is common one for
all StrEnum()s. I made a ValidationError in execute() method to catch up
any discrepancies when other types of trust will be added as Python
doesn't have 'case/switch' so you are left alone with 'if' or list-based
lambdas which don't look so clear.

What we probably want to add is more friendly way to display these
StrEnum values, dropping u'' and simply showing proper unicode as we do
for help already.

Patch freeipa-mkosek-317-improve-strenum-validation-error-message.patch sent for review

Metadata Update from @edewata:
- Issue assigned to mkosek
- Issue set to the milestone: FreeIPA 3.0 RC2

7 years ago

Login to comment on this ticket.

Metadata