Skip to content

Commit fd5f178

Browse files
authored
Sort exceptions alphabetically (#1875)
1 parent e430d03 commit fd5f178

File tree

2 files changed

+88
-84
lines changed

2 files changed

+88
-84
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
## 2.10.0
610

711
### Added

src/LambdaClient.php

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,25 @@ class LambdaClient extends AbstractApi
102102
* '@region'?: string|null,
103103
* }|AddLayerVersionPermissionRequest $input
104104
*
105-
* @throws ServiceException
106-
* @throws ResourceNotFoundException
107-
* @throws ResourceConflictException
108-
* @throws TooManyRequestsException
109105
* @throws InvalidParameterValueException
110106
* @throws PolicyLengthExceededException
111107
* @throws PreconditionFailedException
108+
* @throws ResourceConflictException
109+
* @throws ResourceNotFoundException
110+
* @throws ServiceException
111+
* @throws TooManyRequestsException
112112
*/
113113
public function addLayerVersionPermission($input): AddLayerVersionPermissionResponse
114114
{
115115
$input = AddLayerVersionPermissionRequest::create($input);
116116
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'AddLayerVersionPermission', 'region' => $input->getRegion(), 'exceptionMapping' => [
117-
'ServiceException' => ServiceException::class,
118-
'ResourceNotFoundException' => ResourceNotFoundException::class,
119-
'ResourceConflictException' => ResourceConflictException::class,
120-
'TooManyRequestsException' => TooManyRequestsException::class,
121117
'InvalidParameterValueException' => InvalidParameterValueException::class,
122118
'PolicyLengthExceededException' => PolicyLengthExceededException::class,
123119
'PreconditionFailedException' => PreconditionFailedException::class,
120+
'ResourceConflictException' => ResourceConflictException::class,
121+
'ResourceNotFoundException' => ResourceNotFoundException::class,
122+
'ServiceException' => ServiceException::class,
123+
'TooManyRequestsException' => TooManyRequestsException::class,
124124
]]));
125125

126126
return new AddLayerVersionPermissionResponse($response);
@@ -143,21 +143,21 @@ public function addLayerVersionPermission($input): AddLayerVersionPermissionResp
143143
* '@region'?: string|null,
144144
* }|DeleteFunctionRequest $input
145145
*
146-
* @throws ServiceException
147-
* @throws ResourceNotFoundException
148-
* @throws TooManyRequestsException
149146
* @throws InvalidParameterValueException
150147
* @throws ResourceConflictException
148+
* @throws ResourceNotFoundException
149+
* @throws ServiceException
150+
* @throws TooManyRequestsException
151151
*/
152152
public function deleteFunction($input): Result
153153
{
154154
$input = DeleteFunctionRequest::create($input);
155155
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteFunction', 'region' => $input->getRegion(), 'exceptionMapping' => [
156-
'ServiceException' => ServiceException::class,
157-
'ResourceNotFoundException' => ResourceNotFoundException::class,
158-
'TooManyRequestsException' => TooManyRequestsException::class,
159156
'InvalidParameterValueException' => InvalidParameterValueException::class,
160157
'ResourceConflictException' => ResourceConflictException::class,
158+
'ResourceNotFoundException' => ResourceNotFoundException::class,
159+
'ServiceException' => ServiceException::class,
160+
'TooManyRequestsException' => TooManyRequestsException::class,
161161
]]));
162162

163163
return new Result($response);
@@ -178,19 +178,19 @@ public function deleteFunction($input): Result
178178
* '@region'?: string|null,
179179
* }|GetFunctionConfigurationRequest $input
180180
*
181-
* @throws ServiceException
181+
* @throws InvalidParameterValueException
182182
* @throws ResourceNotFoundException
183+
* @throws ServiceException
183184
* @throws TooManyRequestsException
184-
* @throws InvalidParameterValueException
185185
*/
186186
public function getFunctionConfiguration($input): FunctionConfiguration
187187
{
188188
$input = GetFunctionConfigurationRequest::create($input);
189189
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetFunctionConfiguration', 'region' => $input->getRegion(), 'exceptionMapping' => [
190-
'ServiceException' => ServiceException::class,
190+
'InvalidParameterValueException' => InvalidParameterValueException::class,
191191
'ResourceNotFoundException' => ResourceNotFoundException::class,
192+
'ServiceException' => ServiceException::class,
192193
'TooManyRequestsException' => TooManyRequestsException::class,
193-
'InvalidParameterValueException' => InvalidParameterValueException::class,
194194
]]));
195195

196196
return new FunctionConfiguration($response);
@@ -251,71 +251,71 @@ public function getFunctionConfiguration($input): FunctionConfiguration
251251
* '@region'?: string|null,
252252
* }|InvocationRequest $input
253253
*
254-
* @throws ServiceException
255-
* @throws ResourceNotFoundException
256-
* @throws InvalidRequestContentException
257-
* @throws RequestTooLargeException
258-
* @throws UnsupportedMediaTypeException
259-
* @throws TooManyRequestsException
260-
* @throws InvalidParameterValueException
254+
* @throws EC2AccessDeniedException
255+
* @throws EC2ThrottledException
261256
* @throws EC2UnexpectedException
262-
* @throws SubnetIPAddressLimitReachedException
263-
* @throws ENILimitReachedException
257+
* @throws EFSIOException
264258
* @throws EFSMountConnectivityException
265259
* @throws EFSMountFailureException
266260
* @throws EFSMountTimeoutException
267-
* @throws EFSIOException
268-
* @throws SnapStartException
269-
* @throws SnapStartTimeoutException
270-
* @throws SnapStartNotReadyException
271-
* @throws EC2ThrottledException
272-
* @throws EC2AccessDeniedException
273-
* @throws InvalidSubnetIDException
261+
* @throws ENILimitReachedException
262+
* @throws InvalidParameterValueException
263+
* @throws InvalidRequestContentException
264+
* @throws InvalidRuntimeException
274265
* @throws InvalidSecurityGroupIDException
266+
* @throws InvalidSubnetIDException
275267
* @throws InvalidZipFileException
268+
* @throws KMSAccessDeniedException
276269
* @throws KMSDisabledException
277270
* @throws KMSInvalidStateException
278-
* @throws KMSAccessDeniedException
279271
* @throws KMSNotFoundException
280-
* @throws InvalidRuntimeException
272+
* @throws RecursiveInvocationException
273+
* @throws RequestTooLargeException
281274
* @throws ResourceConflictException
275+
* @throws ResourceNotFoundException
282276
* @throws ResourceNotReadyException
283-
* @throws RecursiveInvocationException
277+
* @throws ServiceException
278+
* @throws SnapStartException
279+
* @throws SnapStartNotReadyException
280+
* @throws SnapStartTimeoutException
281+
* @throws SubnetIPAddressLimitReachedException
282+
* @throws TooManyRequestsException
283+
* @throws UnsupportedMediaTypeException
284284
*/
285285
public function invoke($input): InvocationResponse
286286
{
287287
$input = InvocationRequest::create($input);
288288
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'Invoke', 'region' => $input->getRegion(), 'exceptionMapping' => [
289-
'ServiceException' => ServiceException::class,
290-
'ResourceNotFoundException' => ResourceNotFoundException::class,
291-
'InvalidRequestContentException' => InvalidRequestContentException::class,
292-
'RequestTooLargeException' => RequestTooLargeException::class,
293-
'UnsupportedMediaTypeException' => UnsupportedMediaTypeException::class,
294-
'TooManyRequestsException' => TooManyRequestsException::class,
295-
'InvalidParameterValueException' => InvalidParameterValueException::class,
289+
'EC2AccessDeniedException' => EC2AccessDeniedException::class,
290+
'EC2ThrottledException' => EC2ThrottledException::class,
296291
'EC2UnexpectedException' => EC2UnexpectedException::class,
297-
'SubnetIPAddressLimitReachedException' => SubnetIPAddressLimitReachedException::class,
298-
'ENILimitReachedException' => ENILimitReachedException::class,
292+
'EFSIOException' => EFSIOException::class,
299293
'EFSMountConnectivityException' => EFSMountConnectivityException::class,
300294
'EFSMountFailureException' => EFSMountFailureException::class,
301295
'EFSMountTimeoutException' => EFSMountTimeoutException::class,
302-
'EFSIOException' => EFSIOException::class,
303-
'SnapStartException' => SnapStartException::class,
304-
'SnapStartTimeoutException' => SnapStartTimeoutException::class,
305-
'SnapStartNotReadyException' => SnapStartNotReadyException::class,
306-
'EC2ThrottledException' => EC2ThrottledException::class,
307-
'EC2AccessDeniedException' => EC2AccessDeniedException::class,
308-
'InvalidSubnetIDException' => InvalidSubnetIDException::class,
296+
'ENILimitReachedException' => ENILimitReachedException::class,
297+
'InvalidParameterValueException' => InvalidParameterValueException::class,
298+
'InvalidRequestContentException' => InvalidRequestContentException::class,
299+
'InvalidRuntimeException' => InvalidRuntimeException::class,
309300
'InvalidSecurityGroupIDException' => InvalidSecurityGroupIDException::class,
301+
'InvalidSubnetIDException' => InvalidSubnetIDException::class,
310302
'InvalidZipFileException' => InvalidZipFileException::class,
303+
'KMSAccessDeniedException' => KMSAccessDeniedException::class,
311304
'KMSDisabledException' => KMSDisabledException::class,
312305
'KMSInvalidStateException' => KMSInvalidStateException::class,
313-
'KMSAccessDeniedException' => KMSAccessDeniedException::class,
314306
'KMSNotFoundException' => KMSNotFoundException::class,
315-
'InvalidRuntimeException' => InvalidRuntimeException::class,
307+
'RecursiveInvocationException' => RecursiveInvocationException::class,
308+
'RequestTooLargeException' => RequestTooLargeException::class,
316309
'ResourceConflictException' => ResourceConflictException::class,
310+
'ResourceNotFoundException' => ResourceNotFoundException::class,
317311
'ResourceNotReadyException' => ResourceNotReadyException::class,
318-
'RecursiveInvocationException' => RecursiveInvocationException::class,
312+
'ServiceException' => ServiceException::class,
313+
'SnapStartException' => SnapStartException::class,
314+
'SnapStartNotReadyException' => SnapStartNotReadyException::class,
315+
'SnapStartTimeoutException' => SnapStartTimeoutException::class,
316+
'SubnetIPAddressLimitReachedException' => SubnetIPAddressLimitReachedException::class,
317+
'TooManyRequestsException' => TooManyRequestsException::class,
318+
'UnsupportedMediaTypeException' => UnsupportedMediaTypeException::class,
319319
]]));
320320

321321
return new InvocationResponse($response);
@@ -343,17 +343,17 @@ public function invoke($input): InvocationResponse
343343
* '@region'?: string|null,
344344
* }|ListFunctionsRequest $input
345345
*
346+
* @throws InvalidParameterValueException
346347
* @throws ServiceException
347348
* @throws TooManyRequestsException
348-
* @throws InvalidParameterValueException
349349
*/
350350
public function listFunctions($input = []): ListFunctionsResponse
351351
{
352352
$input = ListFunctionsRequest::create($input);
353353
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListFunctions', 'region' => $input->getRegion(), 'exceptionMapping' => [
354+
'InvalidParameterValueException' => InvalidParameterValueException::class,
354355
'ServiceException' => ServiceException::class,
355356
'TooManyRequestsException' => TooManyRequestsException::class,
356-
'InvalidParameterValueException' => InvalidParameterValueException::class,
357357
]]));
358358

359359
return new ListFunctionsResponse($response, $this, $input);
@@ -379,18 +379,18 @@ public function listFunctions($input = []): ListFunctionsResponse
379379
* '@region'?: string|null,
380380
* }|ListLayerVersionsRequest $input
381381
*
382-
* @throws ServiceException
383382
* @throws InvalidParameterValueException
384383
* @throws ResourceNotFoundException
384+
* @throws ServiceException
385385
* @throws TooManyRequestsException
386386
*/
387387
public function listLayerVersions($input): ListLayerVersionsResponse
388388
{
389389
$input = ListLayerVersionsRequest::create($input);
390390
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListLayerVersions', 'region' => $input->getRegion(), 'exceptionMapping' => [
391-
'ServiceException' => ServiceException::class,
392391
'InvalidParameterValueException' => InvalidParameterValueException::class,
393392
'ResourceNotFoundException' => ResourceNotFoundException::class,
393+
'ServiceException' => ServiceException::class,
394394
'TooManyRequestsException' => TooManyRequestsException::class,
395395
]]));
396396

@@ -413,18 +413,18 @@ public function listLayerVersions($input): ListLayerVersionsResponse
413413
* '@region'?: string|null,
414414
* }|ListVersionsByFunctionRequest $input
415415
*
416-
* @throws ServiceException
417-
* @throws ResourceNotFoundException
418416
* @throws InvalidParameterValueException
417+
* @throws ResourceNotFoundException
418+
* @throws ServiceException
419419
* @throws TooManyRequestsException
420420
*/
421421
public function listVersionsByFunction($input): ListVersionsByFunctionResponse
422422
{
423423
$input = ListVersionsByFunctionRequest::create($input);
424424
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListVersionsByFunction', 'region' => $input->getRegion(), 'exceptionMapping' => [
425-
'ServiceException' => ServiceException::class,
426-
'ResourceNotFoundException' => ResourceNotFoundException::class,
427425
'InvalidParameterValueException' => InvalidParameterValueException::class,
426+
'ResourceNotFoundException' => ResourceNotFoundException::class,
427+
'ServiceException' => ServiceException::class,
428428
'TooManyRequestsException' => TooManyRequestsException::class,
429429
]]));
430430

@@ -452,21 +452,21 @@ public function listVersionsByFunction($input): ListVersionsByFunctionResponse
452452
* '@region'?: string|null,
453453
* }|PublishLayerVersionRequest $input
454454
*
455-
* @throws ServiceException
455+
* @throws CodeStorageExceededException
456+
* @throws InvalidParameterValueException
456457
* @throws ResourceNotFoundException
458+
* @throws ServiceException
457459
* @throws TooManyRequestsException
458-
* @throws InvalidParameterValueException
459-
* @throws CodeStorageExceededException
460460
*/
461461
public function publishLayerVersion($input): PublishLayerVersionResponse
462462
{
463463
$input = PublishLayerVersionRequest::create($input);
464464
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PublishLayerVersion', 'region' => $input->getRegion(), 'exceptionMapping' => [
465-
'ServiceException' => ServiceException::class,
465+
'CodeStorageExceededException' => CodeStorageExceededException::class,
466+
'InvalidParameterValueException' => InvalidParameterValueException::class,
466467
'ResourceNotFoundException' => ResourceNotFoundException::class,
468+
'ServiceException' => ServiceException::class,
467469
'TooManyRequestsException' => TooManyRequestsException::class,
468-
'InvalidParameterValueException' => InvalidParameterValueException::class,
469-
'CodeStorageExceededException' => CodeStorageExceededException::class,
470470
]]));
471471

472472
return new PublishLayerVersionResponse($response);
@@ -515,29 +515,29 @@ public function publishLayerVersion($input): PublishLayerVersionResponse
515515
* '@region'?: string|null,
516516
* }|UpdateFunctionConfigurationRequest $input
517517
*
518-
* @throws ServiceException
519-
* @throws ResourceNotFoundException
520-
* @throws InvalidParameterValueException
521-
* @throws TooManyRequestsException
522-
* @throws ResourceConflictException
523-
* @throws PreconditionFailedException
518+
* @throws CodeSigningConfigNotFoundException
524519
* @throws CodeVerificationFailedException
525520
* @throws InvalidCodeSignatureException
526-
* @throws CodeSigningConfigNotFoundException
521+
* @throws InvalidParameterValueException
522+
* @throws PreconditionFailedException
523+
* @throws ResourceConflictException
524+
* @throws ResourceNotFoundException
525+
* @throws ServiceException
526+
* @throws TooManyRequestsException
527527
*/
528528
public function updateFunctionConfiguration($input): FunctionConfiguration
529529
{
530530
$input = UpdateFunctionConfigurationRequest::create($input);
531531
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'UpdateFunctionConfiguration', 'region' => $input->getRegion(), 'exceptionMapping' => [
532-
'ServiceException' => ServiceException::class,
533-
'ResourceNotFoundException' => ResourceNotFoundException::class,
534-
'InvalidParameterValueException' => InvalidParameterValueException::class,
535-
'TooManyRequestsException' => TooManyRequestsException::class,
536-
'ResourceConflictException' => ResourceConflictException::class,
537-
'PreconditionFailedException' => PreconditionFailedException::class,
532+
'CodeSigningConfigNotFoundException' => CodeSigningConfigNotFoundException::class,
538533
'CodeVerificationFailedException' => CodeVerificationFailedException::class,
539534
'InvalidCodeSignatureException' => InvalidCodeSignatureException::class,
540-
'CodeSigningConfigNotFoundException' => CodeSigningConfigNotFoundException::class,
535+
'InvalidParameterValueException' => InvalidParameterValueException::class,
536+
'PreconditionFailedException' => PreconditionFailedException::class,
537+
'ResourceConflictException' => ResourceConflictException::class,
538+
'ResourceNotFoundException' => ResourceNotFoundException::class,
539+
'ServiceException' => ServiceException::class,
540+
'TooManyRequestsException' => TooManyRequestsException::class,
541541
]]));
542542

543543
return new FunctionConfiguration($response);

0 commit comments

Comments
 (0)