Skip to content

Commit 348e23d

Browse files
committed
fix: error truncation
1 parent ccb762c commit 348e23d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/Cluster/MakesHttpCalls.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ public function call(string $method, string $path, string $payload = '', array $
8484
RequestOptions::BODY => $payload,
8585
]);
8686
} catch (ClientException $e) {
87-
$errorPayload = json_decode((string) $e->getResponse()->getBody(), true);
87+
$errorPayload = json_decode((string) $e->getResponse()->getBody()->getContents(), true);
8888

8989
throw new KubernetesAPIException(
90-
$e->getMessage(),
90+
$errorPayload['message'] ?? $e->getMessage(),
9191
$errorPayload['code'] ?? 0,
9292
$errorPayload
9393
);

0 commit comments

Comments
 (0)