Skip to content

Commit 9e4808c

Browse files
authored
Merge pull request #161 from vostreltsov/160_error_codes
Fix #160: preserve error codes
2 parents a4cb6e2 + 1fc7644 commit 9e4808c

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)