BaseException.php 993 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\common\exception;
  10. use Exception;
  11. class BaseException extends Exception {
  12. private $data = [];
  13. public function __construct($message = "", $code = 0, $data=[]){
  14. parent::__construct($message, $code);
  15. $this->data = $data;
  16. }
  17. /**
  18. * 输出信息
  19. * @return string
  20. */
  21. public function getError(){
  22. // if(env("app_debug")){
  23. // return "服务器繁忙,请稍后在试";
  24. // }
  25. return $this->getMessage();
  26. }
  27. public function getRaw(){
  28. return $this->data;
  29. }
  30. }