Deal with null responses coming back from server #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Investigated #7 a bit deeper.
Turns out that
null
is being used as an error result here.For one_time, the result is an empty string.
So it is safe to add some additional error handling around the return type of the
doActualRequest
method.It detect timeouts and other internal errors.
Besides that, it checks the result. If it is
null
, we assume it is a broken result.More info:
https://github.com/php/php-src/blob/74f7f2c4b1f4d486c7f767a65c02f6e6bab27c3b/ext/soap/soap.c#L2683-L2711
For other transports then the ExtSoapClientTransport, we already assume the output to be a valid string.
E.g. The PSr18Transport will throw exceptions on HTTP errors.