Exception.php 368 B

1234567891011121314151617
  1. <?php
  2. namespace ba;
  3. use think\Exception as E;
  4. /**
  5. * BuildAdmin通用异常类
  6. * catch 到异常后可以直接 $this->error(__($e->getMessage()), $e->getData(), $e->getCode());
  7. */
  8. class Exception extends E
  9. {
  10. public function __construct(protected $message, protected $code = 0, protected $data = [])
  11. {
  12. parent::__construct($message, $code);
  13. }
  14. }