ServerException.php 736B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Aliyun\Core\Exception;
  3. class ServerException extends ClientException
  4. {
  5. private $httpStatus;
  6. private $requestId;
  7. function __construct($errorMessage, $errorCode, $httpStatus, $requestId)
  8. {
  9. $messageStr = $errorCode . " " . $errorMessage . " HTTP Status: " . $httpStatus . " RequestID: " . $requestId;
  10. parent::__construct($messageStr, $errorCode);
  11. $this->setErrorMessage($errorMessage);
  12. $this->setErrorType("Server");
  13. $this->httpStatus = $httpStatus;
  14. $this->requestId = $requestId;
  15. }
  16. public function getHttpStatus()
  17. {
  18. return $this->httpStatus;
  19. }
  20. public function getRequestId()
  21. {
  22. return $this->requestId;
  23. }
  24. }