Skip to content

Commit

Permalink
Merge pull request #161 from vostreltsov/160_error_codes
Browse files Browse the repository at this point in the history
Fix #160: preserve error codes
  • Loading branch information
Stichoza committed Jan 26, 2021
2 parents a4cb6e2 + 1fc7644 commit 9e4808c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GoogleTranslate.php
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 9e4808c

Please sign in to comment.