ClientException.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. /**
  21. * @deprecated See: https://github.com/aliyun/openapi-sdk-php
  22. * Class ClientException
  23. */
  24. class ClientException extends Exception
  25. {
  26. /**
  27. * @var string
  28. */
  29. private $errorCode;
  30. /**
  31. * @var string
  32. */
  33. private $errorMessage;
  34. /**
  35. * @var string
  36. */
  37. private $errorType;
  38. /**
  39. * ClientException constructor.
  40. *
  41. * @param $errorMessage
  42. * @param $errorCode
  43. */
  44. public function __construct($errorMessage, $errorCode)
  45. {
  46. parent::__construct($errorMessage);
  47. $this->errorMessage = $errorMessage;
  48. $this->errorCode = $errorCode;
  49. $this->setErrorType('Client');
  50. }
  51. /**
  52. * @return string
  53. */
  54. public function getErrorCode()
  55. {
  56. return $this->errorCode;
  57. }
  58. /**
  59. * @param $errorCode
  60. */
  61. public function setErrorCode($errorCode)
  62. {
  63. $this->errorCode = $errorCode;
  64. }
  65. /**
  66. * @return string
  67. */
  68. public function getErrorMessage()
  69. {
  70. return $this->errorMessage;
  71. }
  72. /**
  73. * @param $errorMessage
  74. */
  75. public function setErrorMessage($errorMessage)
  76. {
  77. $this->errorMessage = $errorMessage;
  78. }
  79. /**
  80. * @return string
  81. */
  82. public function getErrorType()
  83. {
  84. return $this->errorType;
  85. }
  86. /**
  87. * @param $errorType
  88. */
  89. public function setErrorType($errorType)
  90. {
  91. $this->errorType = $errorType;
  92. }
  93. }