/**
  * Creates a TelegramResponseException.
  *
  * @param TelegramResponse     $response          The response that threw the exception.
  * @param TelegramSDKException $previousException The more detailed exception.
  */
 public function __construct(TelegramResponse $response, TelegramSDKException $previousException = null)
 {
     $this->response = $response;
     $this->responseData = $response->getDecodedBody();
     $errorMessage = $this->get('description', 'Unknown error from API Response.');
     $errorCode = $this->get('error_code', -1);
     parent::__construct($errorMessage, $errorCode, $previousException);
 }
 /**
  * Creates a TelegramResponseException.
  *
  * @param TelegramResponse $response The response that threw the exception.
  * @param string $message
  * @param int $code
  * @param Exception $previous
  */
 public function __construct(TelegramResponse $response, $message = "", $code = 0, Exception $previous = null)
 {
     $this->response = $response;
     $this->responseData = $response->getDecodedBody();
     parent::__construct($message, $code, $previous);
 }