Open liuqingliu opened 8 months ago
如题.版本 krisss/docker-webman:8.0-cli-alpine 需要按文档重写handler方法 protected function solveAllException(Throwable $e) { if ($e instanceof BaseException) { $this->statusCode = $e->statusCode; $this->header = $e->header; $this->errorCode = $e->errorCode; $this->errorMessage = $e->errorMessage; $this->error = $e->error; if (isset($e->data)) { $this->responseData = array_merge($this->responseData, $e->data); } return ; // 在这里直接返回,否则会被下面的方法接管结果.导致500,Internal Server Error } $this->solveExtraException($e); }
验证器是抛出验证器异常ValidateException
ValidateException
如题.版本 krisss/docker-webman:8.0-cli-alpine 需要按文档重写handler方法 protected function solveAllException(Throwable $e) { if ($e instanceof BaseException) { $this->statusCode = $e->statusCode; $this->header = $e->header; $this->errorCode = $e->errorCode; $this->errorMessage = $e->errorMessage; $this->error = $e->error; if (isset($e->data)) { $this->responseData = array_merge($this->responseData, $e->data); } return ; // 在这里直接返回,否则会被下面的方法接管结果.导致500,Internal Server Error } $this->solveExtraException($e); }