fix(utils): 移除了报错且无用的日志

Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
李东云
2022-04-28 20:16:16 +08:00
parent e263c37861
commit 74f776912c

View File

@@ -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;