HttpResponseError.php 564 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace NavOnlineInvoice;
  3. use Exception;
  4. class HttpResponseError extends Exception {
  5. protected $result;
  6. protected $httpStatusCode;
  7. function __construct($result, $httpStatusCode) {
  8. $this->result = $result;
  9. $this->httpStatusCode = $httpStatusCode;
  10. $message = "$result (HTTP Status code: $httpStatusCode)";
  11. parent::__construct($message);
  12. }
  13. public function getResult() {
  14. return $this->result;
  15. }
  16. public function getHttpStatusCode() {
  17. return $this->httpStatusCode;
  18. }
  19. }