stopPropagation(); $content = json_encode([ "status" => 'error', "code" => ErrorCode::PARAMS_INVALID, "result" => [], "message" => $throwable->validator->errors()->first() ]); return $response->withStatus($throwable->status)->withBody(new SwooleStream($content)); } public function isValid(Throwable $throwable): bool { return $throwable instanceof ValidationException; } }