Skip to content

按文档无法正确得到预期异常: BadRequestHttpException, MethodNotAllowedException #14

@liuqingliu

Description

@liuqingliu

如题.版本 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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions