AjaxException.php 396 B

12345678910111213141516171819
  1. <?php
  2. namespace common\components;
  3. use Yii;
  4. class AjaxException extends Exception
  5. {
  6. public function __construct($message = '', $code = 1)
  7. {
  8. Yii::error('code:' . $code . ',message:' . $message);
  9. parent::__construct($code, $message);
  10. }
  11. public static function getInstance($code = 1, $message = '')
  12. {
  13. return new AjaxException($code, $message);
  14. }
  15. }