$throwable->getCode() ?: 500, 'message' => $throwable->getMessage() ?: '服务调用失败', 'request_id' => Context::get('request_id', ''), ]; $protocol = ApplicationContext::getContainer()->get(Protocol::class); // $response->getBody()->write($protocol->pack($data)); $response->getBody()->write($protocol->pack($data)); return $response; } public function isValid(Throwable $throwable): bool { return true; } }