-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Provide friendlier error messages for [endpoint] #2858
Conversation
|
'Invalid Parameter: "extra" is not allowed. "more" is not allowed' | ||
) | ||
expect(e.prettyMessage).to.equal(`${prettyErrorMessage}: extra, more`) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are new tests. The functionality is basically the same except that I've inserted a space after the comma.
.expectJSON({ name: 'custom badge', value: 'invalid response data' }) | ||
.expectJSON({ | ||
name: 'custom badge', | ||
value: 'invalid properties: schemaVersion', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused in terminology differences (properties
vs parameters
vs keys
). Are they all synonymous and if not which is which in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Keys" is the name that's internal to the code. properties seems like the friendliest way to explain to the endpoint provider that the object they're returning doesn't have the right stuff in it. I think it's a little clearer than keys.
I think we use the word "parameters" for query parameters, which makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh okay, i forgot this was the reverse end. it would be invalid/unexpected properties in the response object the endoint was returning that would trigger that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, correct. In this case schemaVersion
is set to an invalid value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm up to speed now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, one question added inline
Ref #2838 (comment)