Commit 625305a1784b39fef3933e6e3af562af635611e3
1 parent
33064f2f
完善错误报告内容
Showing
1 changed file
with
2 additions
and
1 deletions
src/Hris.php
@@ -196,6 +196,7 @@ class Hris | @@ -196,6 +196,7 @@ class Hris | ||
196 | } elseif ($method == 'get') { | 196 | } elseif ($method == 'get') { |
197 | $response = $this->_http->get($url, $data); | 197 | $response = $this->_http->get($url, $data); |
198 | } | 198 | } |
199 | + $body = $response->body(); | ||
199 | $result = $response->json(true); | 200 | $result = $response->json(true); |
200 | $this->log($result, 'Result'); | 201 | $this->log($result, 'Result'); |
201 | if (!isset($result['code']) || $result['code'] != 200) { | 202 | if (!isset($result['code']) || $result['code'] != 200) { |
@@ -207,7 +208,7 @@ class Hris | @@ -207,7 +208,7 @@ class Hris | ||
207 | if (isset($result['msg']) && isset($result['code'])) { | 208 | if (isset($result['msg']) && isset($result['code'])) { |
208 | throw new \Exception('hris SDK Error: ' . $result['msg'] . ':' . $result['code'] . '='. print_r($result, true), $result['code']); | 209 | throw new \Exception('hris SDK Error: ' . $result['msg'] . ':' . $result['code'] . '='. print_r($result, true), $result['code']); |
209 | } else { | 210 | } else { |
210 | - throw new \Exception('hris SDK Error: Result NULL.' .var_export($result, true), 9999); | 211 | + throw new \Exception('hris SDK Error: Result NULL.' .var_export($result, true) . var_export($body, true), 90001); |
211 | } | 212 | } |
212 | } | 213 | } |
213 | 214 |