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
Deferred can be null + add container factories #11
Conversation
/cc @lunetics |
+1! go from me |
@codeliner @basz wanna review? |
ping @codeliner |
src/HttpAsyncMessageProducer.php
Outdated
// we accept only status code 2xx | ||
if ('2' !== substr((string) $response->getStatusCode(), 0, 1)) { | ||
if ($deferred) { | ||
$deferred->reject($response->getReasonPhrase()); |
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.
We should reject with the full error response so that also body and status code can be inspected because this can contain important information to figure out what went wrong
src/HttpAsyncMessageProducer.php
Outdated
if ($deferred) { | ||
$deferred->reject($response->getReasonPhrase()); | ||
} else { | ||
$exception = new RuntimeException($response->getReasonPhrase()); |
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.
same here, maybe a custom exception that takes the response as argument and provides a getter for the error response
@codeliner updated |
resolves #10