| 123456789101112131415161718192021222324 |
- <?php
- declare(strict_types=1);
- /**
- * API exception
- * @author wesmiler
- */
- namespace App\Exception;
- use App\Constants\ErrorCode;
- use Hyperf\Server\Exception\ServerException;
- use Throwable;
- class ApiException extends ServerException
- {
- public function __construct(int $code = 0, string $message = null, Throwable $previous = null)
- {
- if (is_null($message)) {
- $message = ErrorCode::getMessage($code);
- }
- parent::__construct($message, $code, $previous);
- }
- }
|