Skip to content

Commit

Permalink
Update error thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
SamRemis committed Aug 13, 2024
1 parent a06ff3b commit fab9057
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 2 additions & 2 deletions botocore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
from botocore.exceptions import (
NoAuthTokenError,
NoCredentialsError,
NoSupportedSignatureVersionError,
UnknownSignatureVersionError,
UnsupportedSignatureVersionError,
)
from botocore.utils import (
is_valid_ipv6_endpoint_url,
Expand Down Expand Up @@ -1147,7 +1147,7 @@ def resolve_auth_type(auth_trait):
return signature_version
else:
raise UnknownSignatureVersionError(signature_version=auth_type)
raise NoSupportedSignatureVersionError(auth=auth_trait)
raise UnsupportedSignatureVersionError(signature_version=auth_trait)


AUTH_TYPE_MAPS = {
Expand Down
12 changes: 1 addition & 11 deletions botocore/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,6 @@ class UnknownSignatureVersionError(BotoCoreError):
fmt = 'Unknown Signature Version: {signature_version}.'


class NoSupportedSignatureVersionError(BotoCoreError):
"""
None of the requested signature versions are supported by this version of botocore
:ivar auth: The list of requested signature versions.
"""

fmt = 'No supported signatures in requested versions: {auth}.'


class ServiceNotInRegionError(BotoCoreError):
"""
The service is not available in requested region.
Expand Down Expand Up @@ -524,7 +514,7 @@ class UnknownClientMethodError(BotoCoreError):
class UnsupportedSignatureVersionError(BotoCoreError):
"""Error when trying to use an unsupported Signature Version."""

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


class ClientError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/auth/test_auth_trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from botocore.auth import BaseSigner, resolve_auth_type
from botocore.exceptions import (
NoSupportedSignatureVersionError,
UnknownSignatureVersionError,
UnsupportedSignatureVersionError,
)
from tests import mock, unittest

Expand All @@ -38,5 +38,5 @@ def test_invalid_auth_type_error(self):
resolve_auth_type(['aws.auth#invalidAuth'])

def test_no_known_auth_type(self):
with self.assertRaises(NoSupportedSignatureVersionError):
with self.assertRaises(UnsupportedSignatureVersionError):
resolve_auth_type([])

0 comments on commit fab9057

Please sign in to comment.