Commit 7cdf8e78 authored by 谢宇轩's avatar 谢宇轩

refactor: 调整默认返回值逻辑的处理范围

parent 07babe89
......@@ -238,21 +238,11 @@ class Application implements ClientInterface
if ($response->getStatusCode() >= 500) {
if ($this->logger) {
$this->logger->error("sdk error, paypal service fail", $context);
$this->logger->error("sdk error, Upstream service fail", $context);
}
throw new SdkException("SDK Upstream Failed", $request, $response, []);
throw new ApplicationException("SDK Upstream Failed", $request, []);
}
if (in_array($response->getStatusCode(), [404, 405])) {
if ($this->logger) {
$this->logger->error("sdk error, endpoint not found", $context);
}
throw new ApplicationException("Api Endpoint Not Found.", $request, []);
}
$rpcResult = [];
if ($response->getStatusCode() != 304) {
try {
$rpcResult = $this->option->handlingPolicy()->process($response);
} catch (GuiltyResultException $exception) {
......@@ -273,8 +263,6 @@ class Application implements ClientInterface
}
throw new ApplicationException("Content Format error.", $request, []);
}
}
$version = $response->getHeader('ETag');
if (!empty($version)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment