Skip to content

Commit 5fa6362

Browse files
authored
Fix: throw exceptions directly instead of using 'return throw' in ResultConverter
Refs : #181
1 parent 6c41cd2 commit 5fa6362

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/platform/src/Bridge/HuggingFace/ResultConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public function convert(RawResultInterface|RawHttpResult $result, array $options
4747
{
4848
$httpResponse = $result->getObject();
4949
if (503 === $httpResponse->getStatusCode()) {
50-
return throw new RuntimeException('Service unavailable.');
50+
throw new RuntimeException('Service unavailable.');
5151
}
5252

5353
if (404 === $httpResponse->getStatusCode()) {
54-
return throw new InvalidArgumentException('Model, provider or task not found (404).');
54+
throw new InvalidArgumentException('Model, provider or task not found (404).');
5555
}
5656

5757
$headers = $httpResponse->getHeaders(false);

0 commit comments

Comments
 (0)