TeaUnableRetryError.php 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace AlibabaCloud\Tea\Exception;
  3. use AlibabaCloud\Tea\Request;
  4. /**
  5. * Class TeaUnableRetryError.
  6. */
  7. class TeaUnableRetryError extends TeaError
  8. {
  9. private $lastRequest;
  10. private $lastException;
  11. /**
  12. * TeaUnableRetryError constructor.
  13. *
  14. * @param Request $lastRequest
  15. * @param null|\Exception $lastException
  16. */
  17. public function __construct($lastRequest, $lastException = null)
  18. {
  19. $error_info = [];
  20. if (null !== $lastException && $lastException instanceof TeaError) {
  21. $error_info = $lastException->getErrorInfo();
  22. }
  23. parent::__construct($error_info, $lastException->getMessage(), $lastException->getCode(), $lastException);
  24. $this->lastRequest = $lastRequest;
  25. $this->lastException = $lastException;
  26. }
  27. public function getLastRequest()
  28. {
  29. return $this->lastRequest;
  30. }
  31. public function getLastException()
  32. {
  33. return $this->lastException;
  34. }
  35. }