Skip to content

Commit e1aab72

Browse files
committed
Retain request failed message in exception
1 parent c51862e commit e1aab72

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Atomx/ApiClient.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ public function request($method, $url, $options = [])
7373
catch (RequestException $e) {
7474
$response = $e->hasResponse() ? "\nResponse: " . $e->getResponse() : '';
7575

76-
// TODO: Log this info, do not putUrl it in the exception (as it might leak in a dev version etc)
77-
78-
throw new ApiException('Request failed: ' . $e->getRequest() . $response);
76+
throw new ApiException("Request failed: " . $e->getMessage() . "\nRequest:" . $e->getRequest() . $response);
7977
}
8078

81-
// TODO: Be able to reuse the field? or create a new Client every time?
8279
$this->clearFields();
8380

8481
return $this->handleResponse($response);

0 commit comments

Comments
 (0)