Skip to content

Commit 4674c21

Browse files
author
DESKTOP\Kostadin
committed
fix error message truncate
1 parent a22bec5 commit 4674c21

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Common/Request.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Common;
33

44
use GuzzleHttp\Client;
5+
use GuzzleHttp\Exception\BadResponseException;
56

67
abstract class Request {
78

@@ -51,8 +52,8 @@ protected function request($options = [], $url = null, $disableQuery = false) {
5152
]
5253
);
5354
$response = \GuzzleHttp\json_decode($res->getBody()->read($res->getBody()->getSize()));
54-
} catch (\Exception $e) {
55-
throw new \Exception($e->getMessage(), $e->getCode());
55+
} catch (BadResponseException $e) {
56+
throw new \Exception($e->getResponse()->getBody()->getContents(), $e->getCode());
5657
}
5758
return $response;
5859
}

0 commit comments

Comments
 (0)