getCode(), $throwable->getMessage()), JSON_UNESCAPED_UNICODE); // 阻止异常冒泡 $this->stopPropagation(); return $response->withHeader('Content-Type', 'application/json; charset=utf-8')->withStatus(200)->withBody(new SwooleStream($data)); } // 交给下一个异常处理器 return $response; } /** * 判断该异常处理器是否要对该异常进行处理 */ public function isValid(Throwable $throwable): bool { return true; } }