Skip to content

Commit

Permalink
Fix #160: preserve error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
vostreltsov committed Jan 26, 2021
1 parent a4cb6e2 commit 1fc7644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GoogleTranslate.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function getResponse(string $string): array
'query' => $queryUrl,
] + $this->options);
} catch (RequestException $e) {
throw new ErrorException($e->getMessage());
throw new ErrorException($e->getMessage(), $e->getCode());
}

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

0 comments on commit 1fc7644

Please sign in to comment.