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

Provide friendlier error messages for [endpoint] #2858

Merged
merged 2 commits into from
Jan 23, 2019

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow added the service-badge New or updated service badge label Jan 23, 2019
@shields-ci
Copy link

shields-ci commented Jan 23, 2019

Messages
📖 ✨ Thanks for your contribution to Shields, @paulmelnikow!

Generated by 🚫 dangerJS against 281963a

'Invalid Parameter: "extra" is not allowed. "more" is not allowed'
)
expect(e.prettyMessage).to.equal(`${prettyErrorMessage}: extra, more`)
}
Copy link
Member Author

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',
Copy link
Member

@calebcartwright calebcartwright Jan 23, 2019

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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 👍

Copy link
Member

@calebcartwright calebcartwright left a 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

@paulmelnikow paulmelnikow merged commit 4e9763b into master Jan 23, 2019
@shields-deployment
Copy link

This pull request was merged to master branch. This change is now waiting for deployment, which will usually happen within a few days. Stay tuned by joining our #ops channel on Discord!

After deployment, changes are copied to gh-pages branch:

@paulmelnikow paulmelnikow deleted the endpoint-schema-errors branch January 23, 2019 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants