HttpException.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: yunwuxin <448901948@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\exception;
  12. class HttpException extends \RuntimeException
  13. {
  14. private $statusCode;
  15. private $headers;
  16. public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = [], $code = 0)
  17. {
  18. $this->statusCode = $statusCode;
  19. $this->headers = $headers;
  20. parent::__construct($message, $code, $previous);
  21. }
  22. public function getStatusCode()
  23. {
  24. return $this->statusCode;
  25. }
  26. public function getHeaders()
  27. {
  28. return $this->headers;
  29. }
  30. }