Skip to content

[HttpClient][DX] Add URL context to JsonException messages #35822

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

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Feb 21, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets #35762 (comment)
License MIT
Doc PR N/A

In order to help when debugging incorrect JSON responses, this PR adds the requested URL to the error message.

Before: Syntax Error
After: Syntax error, for "https://example.com/file.json".

See the 2nd commit for full diff in new unit tests

@carsonbot carsonbot added Status: Needs Review HttpClient DX DX = Developer eXperience (anything that improves the experience of using Symfony) Bug labels Feb 21, 2020
@GromNaN GromNaN force-pushed the http-client-json-exception branch from 6b7c0cf to 2f61d87 Compare February 21, 2020 22:54
@chalasr chalasr added this to the 4.4 milestone Feb 23, 2020
@nicolas-grekas
Copy link
Member

I saw that you asked for this on Slack: improving the message of an exception is ... an improvement :) As such, this should target master.

@nicolas-grekas nicolas-grekas modified the milestones: 4.4, next Feb 23, 2020
@nicolas-grekas nicolas-grekas force-pushed the http-client-json-exception branch from 2f61d87 to 0653917 Compare February 25, 2020 13:55
@nicolas-grekas
Copy link
Member

Thank you @GromNaN.

@nicolas-grekas nicolas-grekas merged commit cad3f10 into symfony:4.4 Feb 25, 2020
@GromNaN
Copy link
Member Author

GromNaN commented Feb 25, 2020

Thank you @nicolas-grekas for finishing the job.

@GromNaN GromNaN deleted the http-client-json-exception branch February 25, 2020 20:40
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug DX DX = Developer eXperience (anything that improves the experience of using Symfony) HttpClient Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants