Commit 5f2fcc25 authored by 谢宇轩's avatar 谢宇轩

fix: 修复错误上下文写入

parent 66e213ae
...@@ -228,7 +228,7 @@ class Application implements ClientInterface ...@@ -228,7 +228,7 @@ class Application implements ClientInterface
if ($this->logger) { if ($this->logger) {
$this->logger->warning("Error", $this->lastRequestContext); $this->logger->warning("Error", $this->lastRequestContext);
} }
throw new SdkException($exception->getMessage(), $request, $response, $rpcResult); throw new SdkException($exception->getMessage(), $request, $response, $exception->getOptions());
} catch (UnknowResultException $exception) { } catch (UnknowResultException $exception) {
// 无法解析,转化为 Application Exception // 无法解析,转化为 Application Exception
// 日志中保留 OUT PUT // 日志中保留 OUT PUT
......
...@@ -4,6 +4,7 @@ namespace Jiwei\EasyHttpSdk\Helper; ...@@ -4,6 +4,7 @@ namespace Jiwei\EasyHttpSdk\Helper;
trait ArgsRecorder trait ArgsRecorder
{ {
/** /**
* @param string $func * @param string $func
* @param array $params * @param array $params
...@@ -15,6 +16,9 @@ trait ArgsRecorder ...@@ -15,6 +16,9 @@ trait ArgsRecorder
try { try {
$reflectionFunction = new \ReflectionMethod($func); $reflectionFunction = new \ReflectionMethod($func);
foreach ($reflectionFunction->getParameters() as $key => $parameter) { foreach ($reflectionFunction->getParameters() as $key => $parameter) {
if (in_array($key, ['then', 'catch'])) {
continue;
}
$result[$parameter->name] = $params[$key] ?? null; $result[$parameter->name] = $params[$key] ?? null;
} }
}catch (\ReflectionException $exception) { }catch (\ReflectionException $exception) {
...@@ -22,4 +26,4 @@ trait ArgsRecorder ...@@ -22,4 +26,4 @@ trait ArgsRecorder
} }
return $result; return $result;
} }
} }
\ No newline at end of file
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