We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
public function execute(RequestInterface $request): Response { $res = $this->transport->sendRequest($request); $statusCode = $res->getStatusCode(); if ($statusCode >= 400 && $statusCode < 500) { $errorResponse = new Response($res); throw (new InvalidArgumentException( $errorResponse['status']['error'] ?? 'Invalid Argument Exception', $statusCode) )->setResponse($errorResponse); } elseif ($statusCode >= 500) { $errorResponse = new Response($res); throw (new ServerException( $errorResponse['status']['error'] ?? '500 Interval Service Error', $statusCode) )->setResponse($errorResponse); } return new Response($res); }
if sendRequest return null, new Response($res); will report error
The text was updated successfully, but these errors were encountered:
Hello @stingbo, thanks for reporting. I will check soon! Please don't hesitate to create another issue if you face another problem.
Sorry, something went wrong.
Hello @stingbo, technically sendRequest could not return null according to implementation.
sendRequest
class Transport implements ClientInterface { .... public function sendRequest(RequestInterface $request): ResponseInterface { $request = $this->prepareHeaders($request); return $this->client->sendRequest($request); } }
So, for this reason, we don't need to check, especially here, for a null value. Let's close the ticket if you don't have any objection.
No branches or pull requests
if sendRequest return null, new Response($res); will report error
The text was updated successfully, but these errors were encountered: