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

Adding failure-capture information to exception message. #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ghchapman
Copy link

@AgentAntelope @brafales @AdColvinNOTHS I thought I'd do a quick bit of lunchtime ruby!

One thing I always find useful is capturing the values of parameters that lead to an exception in its message. This greatly helps a developer faced with this exception.

I have no doubt that my implementation is not idiomatic ruby, so I'm prepared for comments or all out rejection. :-)

def message
'Invalid Swagger version spec supplied. Svelte supports Swagger v2 only'
%-"swagger" field is #{@supplied_version or 'empty'}. Svelte only supports Swagger v2.0.-

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tradition would be to use %Q{} rather than other delimeters. (Matched delimeters can handle themselves quite well)

@brafales
Copy link
Contributor

brafales commented Feb 4, 2016

Something to bear in mind, the swagger version key changed in swagger 2 as well, so in swagger 2 is swagger whereas in swagger 1.2 is swaggerVersion. So we may have to end up checking for both keys and values.

@AgentAntelope
Copy link

@brafales I think it's better to just not be able to detect it then.

Base automatically changed from master to main March 25, 2021 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants