-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Milestone
Description
Description
When calling and endpoint, and it doesn't respond within the timeout set for guzzle, a PHP Error will be thrown.
It happens because when cathing RequestException, it is not check if Response is set before trying to call getBody() on it.
Error message: Call to a member function getBody() on null
Swagger-codegen version
2.3.0-SNAPSHOT (from docker image)
Steps to reproduce
Call and endpoint and let it time out (by controlling GuzzleRequestOptions::timeout http://docs.guzzlephp.org/en/stable/request-options.html#timeout).
Fx set timeout to 0.1 sec.
Suggest a fix/enhancement
Check that Response is not NULL, before calling getBody() on it