Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST api - error messages should clearly explain the problem, 'invalid value' is too general #3087

Closed
abonas opened this issue Dec 22, 2014 · 5 comments · Fixed by #5786 or #5853
Closed
Assignees
Labels
area/api Indicates an issue on api area. area/usability priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Milestone

Comments

@abonas
Copy link
Contributor

abonas commented Dec 22, 2014

For example, creating a service with id 'redis-master10012345678999' fails and the returned message contains the following:

"message": "service "redis-master10012345678999" is invalid: name: invalid value 'redis-master10012345678999'

'invalid value' is too general, users should understand exactly what is wrong with the input.
for example - is it too long? does it contain characters that are not allowed?

@abonas abonas changed the title REST api - error messages should clearly explain the problem, 'ivalid value' is too general REST api - error messages should clearly explain the problem, 'invalid value' is too general Dec 22, 2014
@thockin
Copy link
Member

thockin commented Dec 22, 2014

Agree - there is now a place to stick the explanations in the
ValidationError - we need to link together validation logic and that string.

On Mon, Dec 22, 2014 at 5:52 AM, abonas notifications@github.com wrote:

For example, creating a service with id 'redis-master10012345678999' fails
and the returned message contains the following:

"message": "service "redis-master10012345678999" is invalid: name:
invalid value 'redis-master10012345678999'

'invalid value' is too general, users should understand exactly what is
wrong with the input.
for example - is it too long? does it contain characters that are not
allowed?

Reply to this email directly or view it on GitHub
#3087.

@goltermann goltermann added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Jan 7, 2015
@bgrant0607 bgrant0607 added the area/api Indicates an issue on api area. label Jan 8, 2015
@bgrant0607 bgrant0607 added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 5, 2015
@bgrant0607 bgrant0607 modified the milestone: v1.0 Feb 6, 2015
@fgrzadkowski fgrzadkowski self-assigned this Mar 16, 2015
@fgrzadkowski
Copy link
Contributor

I checked pkg/api/validation/validation.go and it seems there are only two errors that do not have detailed explanation. I'll send a PR to fix this.

@bgrant0607
Copy link
Member

@fgrzadkowski
Copy link
Contributor

Thanks for the pointer Brian! I'll send second PR to fix this one.

@fgrzadkowski
Copy link
Contributor

Still second PR to be sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. area/usability priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
6 participants