TemplateException.php 522 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace crmeb\exceptions;
  3. use Throwable;
  4. /**
  5. * Class TemplateException
  6. * @package crmeb\exceptions
  7. */
  8. class TemplateException extends \RuntimeException
  9. {
  10. public function __construct($message = "", $code = 0, Throwable $previous = null)
  11. {
  12. if (is_array($message)) {
  13. $errInfo = $message;
  14. $message = $errInfo[0] ?? '未知错误';
  15. $code = $errInfo[1] ?? 400;
  16. }
  17. parent::__construct($message, $code, $previous);
  18. }
  19. }