mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Singularity\HDK\Utils\Exceptions;
|
||||
|
||||
use Hyperf\Contract\StdoutLoggerInterface;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpMessage\Exception\HttpException;
|
||||
use Singularity\HDK\Utils\Constants\CommonErrorCode;
|
||||
use Teapot\StatusCode\RFC\RFC4918;
|
||||
@@ -14,12 +12,6 @@ use Throwable;
|
||||
*/
|
||||
class ValidateException extends HttpException
|
||||
{
|
||||
/**
|
||||
* @Inject
|
||||
* @var \Hyperf\Contract\StdoutLoggerInterface
|
||||
*/
|
||||
private StdoutLoggerInterface $logger;
|
||||
|
||||
public function __construct(
|
||||
int $code = CommonErrorCode::FORMATTER_ERROR,
|
||||
private string $field = '',
|
||||
@@ -27,8 +19,6 @@ class ValidateException extends HttpException
|
||||
private array $availableValue = [],
|
||||
Throwable $previous = null
|
||||
) {
|
||||
/** @noinspection PhpTypedPropertyMightBeUninitializedInspection */
|
||||
$this->logger->error('验证失败,错误码:' . $code);
|
||||
if ($code == CommonErrorCode::FORMATTER_ERROR) {
|
||||
$previous_code = $previous?->getCode();
|
||||
$code = empty($previous_code) ? $code : $previous_code;
|
||||
|
||||
Reference in New Issue
Block a user