Skip to content

Commit 1fc7644

Browse files
committed
Fix #160: preserve error codes
1 parent a4cb6e2 commit 1fc7644

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GoogleTranslate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public function getResponse(string $string): array
308308
'query' => $queryUrl,
309309
] + $this->options);
310310
} catch (RequestException $e) {
311-
throw new ErrorException($e->getMessage());
311+
throw new ErrorException($e->getMessage(), $e->getCode());
312312
}
313313

314314
$body = $response->getBody(); // Get response body

0 commit comments

Comments
 (0)