Skip to content

Commit 68b6181

Browse files
committed
minor #639 [Agent] Use named arguments for exception previous parameter (OskarStark)
This PR was merged into the main branch. Discussion ---------- [Agent] Use named arguments for exception previous parameter | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Remove unnecessary 0 code parameter and use named 'previous' argument for better code readability in RuntimeException constructors. Commits ------- e6c9274 refactor: Use named arguments for exception previous parameter
2 parents d742c66 + e6c9274 commit 68b6181

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/platform/src/Bridge/Gemini/Gemini/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function convertStream(HttpResponse $result): \Generator
9292
try {
9393
$data = json_decode($delta, true, 512, \JSON_THROW_ON_ERROR);
9494
} catch (\JsonException $e) {
95-
throw new RuntimeException('Failed to decode JSON response.', 0, $e);
95+
throw new RuntimeException('Failed to decode JSON response.', previous: $e);
9696
}
9797

9898
$choices = array_map($this->convertChoice(...), $data['candidates'] ?? []);

src/platform/src/Bridge/VertexAi/Gemini/ResultConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private function convertStream(HttpResponse $result): \Generator
9191
try {
9292
$data = json_decode($delta, true, 512, \JSON_THROW_ON_ERROR);
9393
} catch (\JsonException $e) {
94-
throw new RuntimeException('Failed to decode JSON response.', 0, $e);
94+
throw new RuntimeException('Failed to decode JSON response.', previous: $e);
9595
}
9696

9797
$choices = array_map($this->convertChoice(...), $data['candidates'] ?? []);

0 commit comments

Comments
 (0)