Skip to content

Commit fb6de98

Browse files
authored
Sort exceptions alphabetically (#1875)
1 parent 36fcb53 commit fb6de98

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Changed
6+
7+
- Sort exception alphabetically.
8+
59
## 1.2.0
610

711
### Added

src/TranslateClient.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,27 @@ class TranslateClient extends AbstractApi
4040
* '@region'?: string|null,
4141
* }|TranslateTextRequest $input
4242
*
43+
* @throws DetectedLanguageLowConfidenceException
44+
* @throws InternalServerException
4345
* @throws InvalidRequestException
46+
* @throws ResourceNotFoundException
47+
* @throws ServiceUnavailableException
4448
* @throws TextSizeLimitExceededException
4549
* @throws TooManyRequestsException
4650
* @throws UnsupportedLanguagePairException
47-
* @throws DetectedLanguageLowConfidenceException
48-
* @throws ResourceNotFoundException
49-
* @throws InternalServerException
50-
* @throws ServiceUnavailableException
5151
*/
5252
public function translateText($input): TranslateTextResponse
5353
{
5454
$input = TranslateTextRequest::create($input);
5555
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'TranslateText', 'region' => $input->getRegion(), 'exceptionMapping' => [
56+
'DetectedLanguageLowConfidenceException' => DetectedLanguageLowConfidenceException::class,
57+
'InternalServerException' => InternalServerException::class,
5658
'InvalidRequestException' => InvalidRequestException::class,
59+
'ResourceNotFoundException' => ResourceNotFoundException::class,
60+
'ServiceUnavailableException' => ServiceUnavailableException::class,
5761
'TextSizeLimitExceededException' => TextSizeLimitExceededException::class,
5862
'TooManyRequestsException' => TooManyRequestsException::class,
5963
'UnsupportedLanguagePairException' => UnsupportedLanguagePairException::class,
60-
'DetectedLanguageLowConfidenceException' => DetectedLanguageLowConfidenceException::class,
61-
'ResourceNotFoundException' => ResourceNotFoundException::class,
62-
'InternalServerException' => InternalServerException::class,
63-
'ServiceUnavailableException' => ServiceUnavailableException::class,
6464
]]));
6565

6666
return new TranslateTextResponse($response);

0 commit comments

Comments
 (0)