AppException.php 549 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhangdadan
  5. * Date: 2017/6/6
  6. * Time: 23:09
  7. */
  8. namespace app\core\exception;
  9. class AppException extends \RuntimeException
  10. {
  11. private $statusCode;
  12. private $headers;
  13. public function __construct($code = 0, $message = null, \Exception $previous = null, array $headers = [])
  14. {
  15. $this->statusCode = 200;
  16. $this->headers = $headers;
  17. parent::__construct($message, $code, $previous);
  18. }
  19. public function getStatusCode() {
  20. return $this->statusCode;
  21. }
  22. }