Commit f9547bb8 authored by Jakob P's avatar Jakob P
Browse files

Issue #3273706 by nkoporec: Update client request error when no data is received.

parent 985aadd0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -318,6 +318,10 @@ class Client {
          $data = Json::decode($response->getBody()->read($stream_size));

          if ($status_code < 200 || $status_code > 299) {
            if (!$data) {
              throw new ConnectorException("Invalid response", $status_code);
            }

            throw new ConnectorException($data['message'], $data['code'], $data);
          }

@@ -330,6 +334,10 @@ class Client {
          $data = Json::decode($response->getBody()->read($stream_size));

          if ($status_code < 200 || $status_code > 299) {
            if (!$data) {
              throw new ConnectorException("Invalid response", $status_code);
            }

            throw new ConnectorException($data['message'], $data['code'], $data);
          }