Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/botocore/exceptions.py: 87%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

246 statements  

1# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ 

2# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"). You 

5# may not use this file except in compliance with the License. A copy of 

6# the License is located at 

7# 

8# http://aws.amazon.com/apache2.0/ 

9# 

10# or in the "license" file accompanying this file. This file is 

11# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 

12# ANY KIND, either express or implied. See the License for the specific 

13# language governing permissions and limitations under the License. 

14 

15from botocore.vendored import requests 

16from botocore.vendored.requests.packages import urllib3 

17 

18 

19def _exception_from_packed_args(exception_cls, args=None, kwargs=None): 

20 # This is helpful for reducing Exceptions that only accept kwargs as 

21 # only positional arguments can be provided for __reduce__ 

22 # Ideally, this would also be a class method on the BotoCoreError 

23 # but instance methods cannot be pickled. 

24 if args is None: 

25 args = () 

26 if kwargs is None: 

27 kwargs = {} 

28 return exception_cls(*args, **kwargs) 

29 

30 

31class BotoCoreError(Exception): 

32 """ 

33 The base exception class for BotoCore exceptions. 

34 

35 :ivar msg: The descriptive message associated with the error. 

36 """ 

37 

38 fmt = 'An unspecified error occurred' 

39 

40 def __init__(self, **kwargs): 

41 msg = self.fmt.format(**kwargs) 

42 Exception.__init__(self, msg) 

43 self.kwargs = kwargs 

44 

45 def __reduce__(self): 

46 return _exception_from_packed_args, (self.__class__, None, self.kwargs) 

47 

48 

49class DataNotFoundError(BotoCoreError): 

50 """ 

51 The data associated with a particular path could not be loaded. 

52 

53 :ivar data_path: The data path that the user attempted to load. 

54 """ 

55 

56 fmt = 'Unable to load data for: {data_path}' 

57 

58 

59class UnknownServiceError(DataNotFoundError): 

60 """Raised when trying to load data for an unknown service. 

61 

62 :ivar service_name: The name of the unknown service. 

63 

64 """ 

65 

66 fmt = ( 

67 "Unknown service: '{service_name}'. Valid service names are: " 

68 "{known_service_names}" 

69 ) 

70 

71 

72class UnknownRegionError(BotoCoreError): 

73 """Raised when trying to load data for an unknown region. 

74 

75 :ivar region_name: The name of the unknown region. 

76 

77 """ 

78 

79 fmt = "Unknown region: '{region_name}'. {error_msg}" 

80 

81 

82class ApiVersionNotFoundError(BotoCoreError): 

83 """ 

84 The data associated with either the API version or a compatible one 

85 could not be loaded. 

86 

87 :ivar data_path: The data path that the user attempted to load. 

88 :ivar api_version: The API version that the user attempted to load. 

89 """ 

90 

91 fmt = 'Unable to load data {data_path} for: {api_version}' 

92 

93 

94class HTTPClientError(BotoCoreError): 

95 fmt = 'An HTTP Client raised an unhandled exception: {error}' 

96 

97 def __init__(self, request=None, response=None, **kwargs): 

98 self.request = request 

99 self.response = response 

100 super().__init__(**kwargs) 

101 

102 def __reduce__(self): 

103 return _exception_from_packed_args, ( 

104 self.__class__, 

105 (self.request, self.response), 

106 self.kwargs, 

107 ) 

108 

109 

110class ConnectionError(BotoCoreError): 

111 fmt = 'An HTTP Client failed to establish a connection: {error}' 

112 

113 

114class InvalidIMDSEndpointError(BotoCoreError): 

115 fmt = 'Invalid endpoint EC2 Instance Metadata endpoint: {endpoint}' 

116 

117 

118class InvalidIMDSEndpointModeError(BotoCoreError): 

119 fmt = ( 

120 'Invalid EC2 Instance Metadata endpoint mode: {mode}' 

121 ' Valid endpoint modes (case-insensitive): {valid_modes}.' 

122 ) 

123 

124 

125class EndpointConnectionError(ConnectionError): 

126 fmt = 'Could not connect to the endpoint URL: "{endpoint_url}"' 

127 

128 

129class SSLError(ConnectionError, requests.exceptions.SSLError): 

130 fmt = 'SSL validation failed for {endpoint_url} {error}' 

131 

132 

133class ConnectionClosedError(HTTPClientError): 

134 fmt = ( 

135 'Connection was closed before we received a valid response ' 

136 'from endpoint URL: "{endpoint_url}".' 

137 ) 

138 

139 

140class ReadTimeoutError( 

141 HTTPClientError, 

142 requests.exceptions.ReadTimeout, 

143 urllib3.exceptions.ReadTimeoutError, 

144): 

145 fmt = 'Read timeout on endpoint URL: "{endpoint_url}"' 

146 

147 

148class ConnectTimeoutError(ConnectionError, requests.exceptions.ConnectTimeout): 

149 fmt = 'Connect timeout on endpoint URL: "{endpoint_url}"' 

150 

151 

152class ProxyConnectionError(ConnectionError, requests.exceptions.ProxyError): 

153 fmt = 'Failed to connect to proxy URL: "{proxy_url}"' 

154 

155 

156class ResponseStreamingError(HTTPClientError): 

157 fmt = 'An error occurred while reading from response stream: {error}' 

158 

159 

160class NoCredentialsError(BotoCoreError): 

161 """ 

162 No credentials could be found. 

163 """ 

164 

165 fmt = 'Unable to locate credentials' 

166 

167 

168class NoAuthTokenError(BotoCoreError): 

169 """ 

170 No authorization token could be found. 

171 """ 

172 

173 fmt = 'Unable to locate authorization token' 

174 

175 

176class TokenRetrievalError(BotoCoreError): 

177 """ 

178 Error attempting to retrieve a token from a remote source. 

179 

180 :ivar provider: The name of the token provider. 

181 :ivar error_msg: The msg explaining why the token could not be retrieved. 

182 

183 """ 

184 

185 fmt = 'Error when retrieving token from {provider}: {error_msg}' 

186 

187 

188class UnknownTokenProviderError(BotoCoreError): 

189 """Tried to insert before/after an unregistered token provider.""" 

190 

191 fmt = 'Token provider named {name} not found.' 

192 

193 

194class PartialCredentialsError(BotoCoreError): 

195 """ 

196 Only partial credentials were found. 

197 

198 :ivar cred_var: The missing credential variable name. 

199 

200 """ 

201 

202 fmt = 'Partial credentials found in {provider}, missing: {cred_var}' 

203 

204 

205class CredentialRetrievalError(BotoCoreError): 

206 """ 

207 Error attempting to retrieve credentials from a remote source. 

208 

209 :ivar provider: The name of the credential provider. 

210 :ivar error_msg: The msg explaining why credentials could not be 

211 retrieved. 

212 

213 """ 

214 

215 fmt = 'Error when retrieving credentials from {provider}: {error_msg}' 

216 

217 

218class UnknownSignatureVersionError(BotoCoreError): 

219 """ 

220 Requested Signature Version is not known. 

221 

222 :ivar signature_version: The name of the requested signature version. 

223 """ 

224 

225 fmt = 'Unknown Signature Version: {signature_version}.' 

226 

227 

228class ServiceNotInRegionError(BotoCoreError): 

229 """ 

230 The service is not available in requested region. 

231 

232 :ivar service_name: The name of the service. 

233 :ivar region_name: The name of the region. 

234 """ 

235 

236 fmt = 'Service {service_name} not available in region {region_name}' 

237 

238 

239class BaseEndpointResolverError(BotoCoreError): 

240 """Base error for endpoint resolving errors. 

241 

242 Should never be raised directly, but clients can catch 

243 this exception if they want to generically handle any errors 

244 during the endpoint resolution process. 

245 

246 """ 

247 

248 

249class NoRegionError(BaseEndpointResolverError): 

250 """No region was specified.""" 

251 

252 fmt = 'You must specify a region.' 

253 

254 

255class EndpointVariantError(BaseEndpointResolverError): 

256 """ 

257 Could not construct modeled endpoint variant. 

258 

259 :ivar error_msg: The message explaining why the modeled endpoint variant 

260 is unable to be constructed. 

261 

262 """ 

263 

264 fmt = ( 

265 'Unable to construct a modeled endpoint with the following ' 

266 'variant(s) {tags}: ' 

267 ) 

268 

269 

270class UnknownEndpointError(BaseEndpointResolverError, ValueError): 

271 """ 

272 Could not construct an endpoint. 

273 

274 :ivar service_name: The name of the service. 

275 :ivar region_name: The name of the region. 

276 """ 

277 

278 fmt = ( 

279 'Unable to construct an endpoint for ' 

280 '{service_name} in region {region_name}' 

281 ) 

282 

283 

284class UnknownFIPSEndpointError(BaseEndpointResolverError): 

285 """ 

286 Could not construct a FIPS endpoint. 

287 

288 :ivar service_name: The name of the service. 

289 :ivar region_name: The name of the region. 

290 """ 

291 

292 fmt = ( 

293 'The provided FIPS pseudo-region "{region_name}" is not known for ' 

294 'the service "{service_name}". A FIPS compliant endpoint cannot be ' 

295 'constructed.' 

296 ) 

297 

298 

299class ProfileNotFound(BotoCoreError): 

300 """ 

301 The specified configuration profile was not found in the 

302 configuration file. 

303 

304 :ivar profile: The name of the profile the user attempted to load. 

305 """ 

306 

307 fmt = 'The config profile ({profile}) could not be found' 

308 

309 

310class ConfigParseError(BotoCoreError): 

311 """ 

312 The configuration file could not be parsed. 

313 

314 :ivar path: The path to the configuration file. 

315 """ 

316 

317 fmt = 'Unable to parse config file: {path}' 

318 

319 

320class ConfigNotFound(BotoCoreError): 

321 """ 

322 The specified configuration file could not be found. 

323 

324 :ivar path: The path to the configuration file. 

325 """ 

326 

327 fmt = 'The specified config file ({path}) could not be found.' 

328 

329 

330class MissingParametersError(BotoCoreError): 

331 """ 

332 One or more required parameters were not supplied. 

333 

334 :ivar object: The object that has missing parameters. 

335 This can be an operation or a parameter (in the 

336 case of inner params). The str() of this object 

337 will be used so it doesn't need to implement anything 

338 other than str(). 

339 :ivar missing: The names of the missing parameters. 

340 """ 

341 

342 fmt = ( 

343 'The following required parameters are missing for ' 

344 '{object_name}: {missing}' 

345 ) 

346 

347 

348class ValidationError(BotoCoreError): 

349 """ 

350 An exception occurred validating parameters. 

351 

352 Subclasses must accept a ``value`` and ``param`` 

353 argument in their ``__init__``. 

354 

355 :ivar value: The value that was being validated. 

356 :ivar param: The parameter that failed validation. 

357 :ivar type_name: The name of the underlying type. 

358 """ 

359 

360 fmt = "Invalid value ('{value}') for param {param} of type {type_name} " 

361 

362 

363class ParamValidationError(BotoCoreError): 

364 fmt = 'Parameter validation failed:\n{report}' 

365 

366 

367# These exceptions subclass from ValidationError so that code 

368# can just 'except ValidationError' to catch any possibly validation 

369# error. 

370class UnknownKeyError(ValidationError): 

371 """ 

372 Unknown key in a struct parameter. 

373 

374 :ivar value: The value that was being checked. 

375 :ivar param: The name of the parameter. 

376 :ivar choices: The valid choices the value can be. 

377 """ 

378 

379 fmt = ( 

380 "Unknown key '{value}' for param '{param}'. Must be one of: {choices}" 

381 ) 

382 

383 

384class RangeError(ValidationError): 

385 """ 

386 A parameter value was out of the valid range. 

387 

388 :ivar value: The value that was being checked. 

389 :ivar param: The parameter that failed validation. 

390 :ivar min_value: The specified minimum value. 

391 :ivar max_value: The specified maximum value. 

392 """ 

393 

394 fmt = ( 

395 'Value out of range for param {param}: ' 

396 '{min_value} <= {value} <= {max_value}' 

397 ) 

398 

399 

400class UnknownParameterError(ValidationError): 

401 """ 

402 Unknown top level parameter. 

403 

404 :ivar name: The name of the unknown parameter. 

405 :ivar operation: The name of the operation. 

406 :ivar choices: The valid choices the parameter name can be. 

407 """ 

408 

409 fmt = ( 

410 "Unknown parameter '{name}' for operation {operation}. Must be one " 

411 "of: {choices}" 

412 ) 

413 

414 

415class InvalidRegionError(ValidationError, ValueError): 

416 """ 

417 Invalid region_name provided to client or resource. 

418 

419 :ivar region_name: region_name that was being validated. 

420 """ 

421 

422 fmt = "Provided region_name '{region_name}' doesn't match a supported format." 

423 

424 

425class AliasConflictParameterError(ValidationError): 

426 """ 

427 Error when an alias is provided for a parameter as well as the original. 

428 

429 :ivar original: The name of the original parameter. 

430 :ivar alias: The name of the alias 

431 :ivar operation: The name of the operation. 

432 """ 

433 

434 fmt = ( 

435 "Parameter '{original}' and its alias '{alias}' were provided " 

436 "for operation {operation}. Only one of them may be used." 

437 ) 

438 

439 

440class UnknownServiceStyle(BotoCoreError): 

441 """ 

442 Unknown style of service invocation. 

443 

444 :ivar service_style: The style requested. 

445 """ 

446 

447 fmt = 'The service style ({service_style}) is not understood.' 

448 

449 

450class PaginationError(BotoCoreError): 

451 fmt = 'Error during pagination: {message}' 

452 

453 

454class OperationNotPageableError(BotoCoreError): 

455 fmt = 'Operation cannot be paginated: {operation_name}' 

456 

457 

458class ChecksumError(BotoCoreError): 

459 """The expected checksum did not match the calculated checksum.""" 

460 

461 fmt = ( 

462 'Checksum {checksum_type} failed, expected checksum ' 

463 '{expected_checksum} did not match calculated checksum ' 

464 '{actual_checksum}.' 

465 ) 

466 

467 

468class UnseekableStreamError(BotoCoreError): 

469 """Need to seek a stream, but stream does not support seeking.""" 

470 

471 fmt = ( 

472 'Need to rewind the stream {stream_object}, but stream ' 

473 'is not seekable.' 

474 ) 

475 

476 

477class WaiterError(BotoCoreError): 

478 """Waiter failed to reach desired state.""" 

479 

480 fmt = 'Waiter {name} failed: {reason}' 

481 

482 def __init__(self, name, reason, last_response): 

483 super().__init__(name=name, reason=reason) 

484 self.last_response = last_response 

485 

486 

487class IncompleteReadError(BotoCoreError): 

488 """HTTP response did not return expected number of bytes.""" 

489 

490 fmt = '{actual_bytes} read, but total bytes expected is {expected_bytes}.' 

491 

492 

493class InvalidExpressionError(BotoCoreError): 

494 """Expression is either invalid or too complex.""" 

495 

496 fmt = 'Invalid expression {expression}: Only dotted lookups are supported.' 

497 

498 

499class UnknownCredentialError(BotoCoreError): 

500 """Tried to insert before/after an unregistered credential type.""" 

501 

502 fmt = 'Credential named {name} not found.' 

503 

504 

505class WaiterConfigError(BotoCoreError): 

506 """Error when processing waiter configuration.""" 

507 

508 fmt = 'Error processing waiter config: {error_msg}' 

509 

510 

511class UnknownClientMethodError(BotoCoreError): 

512 """Error when trying to access a method on a client that does not exist.""" 

513 

514 fmt = 'Client does not have method: {method_name}' 

515 

516 

517class UnsupportedSignatureVersionError(BotoCoreError): 

518 """Error when trying to use an unsupported Signature Version.""" 

519 

520 fmt = 'Signature version(s) are not supported: {signature_version}' 

521 

522 

523class ClientError(Exception): 

524 MSG_TEMPLATE = ( 

525 'An error occurred ({error_code}) when calling the {operation_name} ' 

526 'operation{retry_info}: {error_message}' 

527 ) 

528 

529 def __init__(self, error_response, operation_name): 

530 retry_info = self._get_retry_info(error_response) 

531 error = error_response.get('Error', {}) 

532 msg = self.MSG_TEMPLATE.format( 

533 error_code=error.get('Code', 'Unknown'), 

534 error_message=error.get('Message', 'Unknown'), 

535 operation_name=operation_name, 

536 retry_info=retry_info, 

537 ) 

538 super().__init__(msg) 

539 self.response = error_response 

540 self.operation_name = operation_name 

541 

542 def _get_retry_info(self, response): 

543 retry_info = '' 

544 if 'ResponseMetadata' in response: 

545 metadata = response['ResponseMetadata'] 

546 if metadata.get('MaxAttemptsReached', False): 

547 if 'RetryAttempts' in metadata: 

548 retry_info = ( 

549 f" (reached max retries: {metadata['RetryAttempts']})" 

550 ) 

551 return retry_info 

552 

553 def __reduce__(self): 

554 # Subclasses of ClientError's are dynamically generated and 

555 # cannot be pickled unless they are attributes of a 

556 # module. So at the very least return a ClientError back. 

557 return ClientError, (self.response, self.operation_name) 

558 

559 

560class EventStreamError(ClientError): 

561 pass 

562 

563 

564class UnsupportedTLSVersionWarning(Warning): 

565 """Warn when an openssl version that uses TLS 1.2 is required""" 

566 

567 pass 

568 

569 

570class ImminentRemovalWarning(Warning): 

571 pass 

572 

573 

574class InvalidDNSNameError(BotoCoreError): 

575 """Error when virtual host path is forced on a non-DNS compatible bucket""" 

576 

577 fmt = ( 

578 'Bucket named {bucket_name} is not DNS compatible. Virtual ' 

579 'hosted-style addressing cannot be used. The addressing style ' 

580 'can be configured by removing the addressing_style value ' 

581 'or setting that value to \'path\' or \'auto\' in the AWS Config ' 

582 'file or in the botocore.client.Config object.' 

583 ) 

584 

585 

586class InvalidS3AddressingStyleError(BotoCoreError): 

587 """Error when an invalid path style is specified""" 

588 

589 fmt = ( 

590 'S3 addressing style {s3_addressing_style} is invalid. Valid options ' 

591 'are: \'auto\', \'virtual\', and \'path\'' 

592 ) 

593 

594 

595class UnsupportedS3ArnError(BotoCoreError): 

596 """Error when S3 ARN provided to Bucket parameter is not supported""" 

597 

598 fmt = ( 

599 'S3 ARN {arn} provided to "Bucket" parameter is invalid. Only ' 

600 'ARNs for S3 access-points are supported.' 

601 ) 

602 

603 

604class UnsupportedS3ControlArnError(BotoCoreError): 

605 """Error when S3 ARN provided to S3 control parameter is not supported""" 

606 

607 fmt = 'S3 ARN "{arn}" provided is invalid for this operation. {msg}' 

608 

609 

610class InvalidHostLabelError(BotoCoreError): 

611 """Error when an invalid host label would be bound to an endpoint""" 

612 

613 fmt = ( 

614 'Invalid host label to be bound to the hostname of the endpoint: ' 

615 '"{label}".' 

616 ) 

617 

618 

619class UnsupportedOutpostResourceError(BotoCoreError): 

620 """Error when S3 Outpost ARN provided to Bucket parameter is incomplete""" 

621 

622 fmt = ( 

623 'S3 Outpost ARN resource "{resource_name}" provided to "Bucket" ' 

624 'parameter is invalid. Only ARNs for S3 Outpost arns with an ' 

625 'access-point sub-resource are supported.' 

626 ) 

627 

628 

629class UnsupportedS3ConfigurationError(BotoCoreError): 

630 """Error when an unsupported configuration is used with access-points""" 

631 

632 fmt = 'Unsupported configuration when using S3: {msg}' 

633 

634 

635class UnsupportedS3AccesspointConfigurationError(BotoCoreError): 

636 """Error when an unsupported configuration is used with access-points""" 

637 

638 fmt = 'Unsupported configuration when using S3 access-points: {msg}' 

639 

640 

641class InvalidEndpointDiscoveryConfigurationError(BotoCoreError): 

642 """Error when invalid value supplied for endpoint_discovery_enabled""" 

643 

644 fmt = ( 

645 'Unsupported configuration value for endpoint_discovery_enabled. ' 

646 'Expected one of ("true", "false", "auto") but got {config_value}.' 

647 ) 

648 

649 

650class UnsupportedS3ControlConfigurationError(BotoCoreError): 

651 """Error when an unsupported configuration is used with S3 Control""" 

652 

653 fmt = 'Unsupported configuration when using S3 Control: {msg}' 

654 

655 

656class InvalidRetryConfigurationError(BotoCoreError): 

657 """Error when invalid retry configuration is specified""" 

658 

659 fmt = ( 

660 'Cannot provide retry configuration for "{retry_config_option}". ' 

661 'Valid retry configuration options are: {valid_options}' 

662 ) 

663 

664 

665class InvalidMaxRetryAttemptsError(InvalidRetryConfigurationError): 

666 """Error when invalid retry configuration is specified""" 

667 

668 fmt = ( 

669 'Value provided to "max_attempts": {provided_max_attempts} must ' 

670 'be an integer greater than or equal to {min_value}.' 

671 ) 

672 

673 

674class InvalidRetryModeError(InvalidRetryConfigurationError): 

675 """Error when invalid retry mode configuration is specified""" 

676 

677 fmt = ( 

678 'Invalid value provided to "mode": "{provided_retry_mode}" must ' 

679 'be one of: {valid_modes}' 

680 ) 

681 

682 

683class InvalidS3UsEast1RegionalEndpointConfigError(BotoCoreError): 

684 """Error for invalid s3 us-east-1 regional endpoints configuration""" 

685 

686 fmt = ( 

687 'S3 us-east-1 regional endpoint option ' 

688 '{s3_us_east_1_regional_endpoint_config} is ' 

689 'invalid. Valid options are: "legacy", "regional"' 

690 ) 

691 

692 

693class InvalidSTSRegionalEndpointsConfigError(BotoCoreError): 

694 """Error when invalid sts regional endpoints configuration is specified""" 

695 

696 fmt = ( 

697 'STS regional endpoints option {sts_regional_endpoints_config} is ' 

698 'invalid. Valid options are: "legacy", "regional"' 

699 ) 

700 

701 

702class StubResponseError(BotoCoreError): 

703 fmt = ( 

704 'Error getting response stub for operation {operation_name}: {reason}' 

705 ) 

706 

707 

708class StubAssertionError(StubResponseError, AssertionError): 

709 pass 

710 

711 

712class UnStubbedResponseError(StubResponseError): 

713 pass 

714 

715 

716class InvalidConfigError(BotoCoreError): 

717 fmt = '{error_msg}' 

718 

719 

720class InfiniteLoopConfigError(InvalidConfigError): 

721 fmt = ( 

722 'Infinite loop in credential configuration detected. Attempting to ' 

723 'load from profile {source_profile} which has already been visited. ' 

724 'Visited profiles: {visited_profiles}' 

725 ) 

726 

727 

728class RefreshWithMFAUnsupportedError(BotoCoreError): 

729 fmt = 'Cannot refresh credentials: MFA token required.' 

730 

731 

732class MD5UnavailableError(BotoCoreError): 

733 fmt = "This system does not support MD5 generation." 

734 

735 

736class MissingDependencyException(BotoCoreError): 

737 fmt = "Missing Dependency: {msg}" 

738 

739 

740class MetadataRetrievalError(BotoCoreError): 

741 fmt = "Error retrieving metadata: {error_msg}" 

742 

743 

744class UndefinedModelAttributeError(Exception): 

745 pass 

746 

747 

748class MissingServiceIdError(UndefinedModelAttributeError): 

749 fmt = ( 

750 "The model being used for the service {service_name} is missing the " 

751 "serviceId metadata property, which is required." 

752 ) 

753 

754 def __init__(self, **kwargs): 

755 msg = self.fmt.format(**kwargs) 

756 Exception.__init__(self, msg) 

757 self.kwargs = kwargs 

758 

759 

760class SSOError(BotoCoreError): 

761 fmt = ( 

762 "An unspecified error happened when resolving AWS credentials or an " 

763 "access token from SSO." 

764 ) 

765 

766 

767class SSOTokenLoadError(SSOError): 

768 fmt = "Error loading SSO Token: {error_msg}" 

769 

770 

771class UnauthorizedSSOTokenError(SSOError): 

772 fmt = ( 

773 "The SSO session associated with this profile has expired or is " 

774 "otherwise invalid. To refresh this SSO session run aws sso login " 

775 "with the corresponding profile." 

776 ) 

777 

778 

779class LoginError(BotoCoreError): 

780 fmt = ( 

781 "An unspecified error happened when resolving AWS credentials or " 

782 "refreshing a login session profile." 

783 ) 

784 

785 

786class LoginRefreshRequired(LoginError): 

787 fmt = "Your session has expired or credentials have changed. Please reauthenticate using 'aws login'." 

788 

789 

790class LoginInsufficientPermissions(LoginError): 

791 fmt = ( 

792 "Unable to create or refresh login credentials due to insufficient " 

793 "permissions. You may be missing permission for the 'signin:CreateOAuth2Token' action." 

794 ) 

795 

796 

797class LoginTokenLoadError(LoginError): 

798 fmt = "Error loading login session token: {error_msg}" 

799 

800 

801class LoginAuthorizationCodeError(LoginError): 

802 fmt = "Error loading or redeeming a login authorization code: {error_msg} " 

803 

804 

805class CapacityNotAvailableError(BotoCoreError): 

806 fmt = 'Insufficient request capacity available.' 

807 

808 

809class InvalidProxiesConfigError(BotoCoreError): 

810 fmt = 'Invalid configuration value(s) provided for proxies_config.' 

811 

812 

813class InvalidDefaultsMode(BotoCoreError): 

814 fmt = ( 

815 'Client configured with invalid defaults mode: {mode}. ' 

816 'Valid defaults modes include: {valid_modes}.' 

817 ) 

818 

819 

820class AwsChunkedWrapperError(BotoCoreError): 

821 fmt = '{error_msg}' 

822 

823 

824class FlexibleChecksumError(BotoCoreError): 

825 fmt = '{error_msg}' 

826 

827 

828class InvalidEndpointConfigurationError(BotoCoreError): 

829 fmt = 'Invalid endpoint configuration: {msg}' 

830 

831 

832class EndpointProviderError(BotoCoreError): 

833 """Base error for the EndpointProvider class""" 

834 

835 fmt = '{msg}' 

836 

837 

838class EndpointResolutionError(EndpointProviderError): 

839 """Error when input parameters resolve to an error rule""" 

840 

841 fmt = '{msg}' 

842 

843 

844class UnknownEndpointResolutionBuiltInName(EndpointProviderError): 

845 fmt = 'Unknown builtin variable name: {name}' 

846 

847 

848class InvalidChecksumConfigError(BotoCoreError): 

849 """Error when an invalid checksum config value is supplied.""" 

850 

851 fmt = ( 

852 'Unsupported configuration value for {config_key}. ' 

853 'Expected one of {valid_options} but got {config_value}.' 

854 ) 

855 

856 

857class UnsupportedServiceProtocolsError(BotoCoreError): 

858 """Error when a service does not use any protocol supported by botocore.""" 

859 

860 fmt = ( 

861 'Botocore supports {botocore_supported_protocols}, but service {service} only ' 

862 'supports {service_supported_protocols}.' 

863 )