Skip to content

Commit

Permalink
feat: 增加 InvalidConfigException (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yansongda authored Jan 8, 2024
1 parent ee50b4d commit 0a25d93
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v1.0.3

### added

- feat: 增加 `InvalidConfigException`(!4)

## v1.0.2

### changed
Expand Down
5 changes: 5 additions & 0 deletions src/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class Exception extends \Exception

public const RESPONSE_EMPTY = 9303;

/**
* 关于配置.
*/
public const CONFIG_ERROR = 9400;

public mixed $extra;

public function __construct(string $message = '未知异常', int $code = self::UNKNOWN_ERROR, mixed $extra = null, ?Throwable $previous = null)
Expand Down
15 changes: 15 additions & 0 deletions src/Exception/InvalidConfigException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Yansongda\Artful\Exception;

use Throwable;

class InvalidConfigException extends Exception
{
public function __construct(int $code = self::CONFIG_ERROR, string $message = '配置异常', mixed $extra = null, ?Throwable $previous = null)
{
parent::__construct($message, $code, $extra, $previous);
}
}

0 comments on commit 0a25d93

Please sign in to comment.