Skip to content

Commit e158375

Browse files
committed
Change getRequestId function to pull straight from response
1 parent c12a2a6 commit e158375

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Exception/ApiException.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ class ApiException extends UKFastException
1010

1111
protected $response;
1212

13-
/**
14-
* @var string
15-
*/
16-
protected $requestId = null;
17-
1813
public function __construct($response)
1914
{
2015
$response->getBody()->rewind();
@@ -70,7 +65,11 @@ public function getResponse()
7065

7166
public function getRequestId()
7267
{
73-
return $this->requestId;
68+
if (!empty($this->response->getHeader('Request-ID'))) {
69+
return $this->response->getHeader('Request-ID')[0];
70+
}
71+
72+
return null;
7473
}
7574

7675
private function getErrorsFromBody($body)

0 commit comments

Comments
 (0)