src/M2X.php
protected function handleResponse(HttpResponse $response) {
    $this->lastResponse = $response;

    if ($response->success()) {
      return $response;
    }

    throw new M2XException($response);
  }
protected function handleResponse(HttpResponse $response) {
    $this->lastResponse = $response;

    if ($response->success()) {
      return $response;
    }

    throw new M2XException($response);
  }
protected function handleResponse ( HttpResponse $ response ) { $ this -> lastResponse = $ response ; if ( $ response -> success ( ) ) { return $ response ; } throw new M2XException ( $ response ) ; }
Checks the HttpResponse for errors and throws an exception, if
no errors are encountered, the HttpResponse is returned.

@param HttpResponse $response
@return HttpResponse
@throws M2XException
Checks the HttpResponse for errors and throws an exception if no errors are encountered the HttpResponse is returned .