Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] exceptions carry response#30567

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@antonch1989
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#30502
LicenseMIT
Doc PR

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks for starting this.
I think we should add the method in an interface in contracts.
If we add it to the baseExceptionInterface, it should be nullable, because the response object might not be instantiated yet when this is thrown.
We could alternatively add a new baseHttpExceptionInterface that would add this method toServer/Client/RedirectionExceptionInterface - that's mean the method is not onTransportExceptionInterface.
Any preference?

*/
trait HttpExceptionTrait
{
/** @var ResponseInterface */

Choose a reason for hiding this comment

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

should be removed

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

the solution with a new interface looks cleaner, I'll do this way if there are no objections


useSymfony\Contracts\HttpClient\ResponseInterface;

interface HttpExceptionInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think ofHttpResponseExceptionInterface? The current name doesn't imply it has anything to do with a response, while the getter implies there'salways a response

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

In my opinion the current naming is fine, let's wait for some other comments

Choose a reason for hiding this comment

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

I'm fine with the nameHttpExceptionInterface personnaly, but the interface should extendExceptionInterface


useSymfony\Contracts\HttpClient\ResponseInterface;

interface HttpExceptionInterface

Choose a reason for hiding this comment

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

I'm fine with the nameHttpExceptionInterface personnaly, but the interface should extendExceptionInterface

* @experimental in 1.1
*/
interface RedirectionExceptionInterfaceextends ExceptionInterface
interface RedirectionExceptionInterfaceextends ExceptionInterface, HttpExceptionInterface

Choose a reason for hiding this comment

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

interface RedirectionExceptionInterface extends HttpExceptionInterface
please do the sameClientExceptionInterface andServerExceptionInterface

* @experimental in 1.1
*/
interface ClientExceptionInterfaceextends ExceptionInterface
interface ClientExceptionInterfaceextends ExceptionInterface, HttpExceptionInterface

Choose a reason for hiding this comment

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

ExceptionInterface should be removed as it's now embeded in HttpExceptionInterface
same in the 2 other exception interfaces

useSymfony\Contracts\HttpClient\ResponseInterface;

/**
* Interface for getting response from an exception

Choose a reason for hiding this comment

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

Base interface for HTTP-related exceptions.

@fabpot
Copy link
Member

Thank you@antonch1989.

@fabpotfabpotforce-pushed theissue-30502-exceptions-carry-respons branch frombf99300 to103448cCompareMarch 19, 2019 07:50
@fabpotfabpot merged commit103448c intosymfony:masterMar 19, 2019
fabpot added a commit that referenced this pull requestMar 19, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes#30567).Discussion----------[HttpClient] exceptions carry response| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#30502| License       | MIT| Doc PR        |Commits-------103448c [HttpClient] exceptions carry response
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@linaorilinaorilinaori left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@antonch1989@fabpot@nicolas-grekas@linaori@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp