• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

localstack / localstack / 21463896295

28 Jan 2026 01:12PM UTC coverage: 86.955% (-0.02%) from 86.973%
21463896295

push

github

web-flow
Upgrade moto-ext (#13652)

Co-authored-by: LocalStack Bot <localstack-bot@users.noreply.github.com>
Co-authored-by: Benjamin Simon <benjh.simon@gmail.com>

2 of 2 new or added lines in 1 file covered. (100.0%)

31 existing lines in 9 files now uncovered.

70352 of 80906 relevant lines covered (86.96%)

0.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.11
/localstack-core/localstack/aws/catalog_exceptions.py
1
from localstack.aws.api import CommonServiceException
1✔
2
from localstack.utils.catalog.common import (
1✔
3
    AwsServiceOperationsSupportInLatest,
4
    AwsServicesSupportInLatest,
5
    AwsServiceSupportAtRuntime,
6
)
7

8
_DOCS_COVERAGE_URL = "https://docs.localstack.cloud/references/coverage"
1✔
9

10

11
class AwsServiceAvailabilityException(CommonServiceException):
1✔
12
    def __init__(self, message: str, error_code: int):
1✔
13
        super().__init__(code="InternalFailure", message=message, status_code=501)
1✔
14
        self.error_code = error_code
1✔
15

16

17
class ServiceOrOperationNotSupportedException(AwsServiceAvailabilityException):
1✔
18
    def __init__(self, service_name: str, operation_name: str | None = None):
1✔
19
        if operation_name is None:
1✔
20
            message = f"Sorry, the {service_name} service is not currently supported by LocalStack."
×
21
            error_code = 3
×
22
        else:
23
            message = f"Sorry, the {operation_name} operation on the {service_name} service is not currently supported by LocalStack."
1✔
24
            error_code = 8
1✔
25
        super().__init__(message, error_code)
1✔
26

27

28
class LatestVersionRequiredException(AwsServiceAvailabilityException):
1✔
29
    def __init__(self, service_name: str, operation_name: str | None = None):
1✔
30
        if operation_name is None:
×
31
            message = f"Sorry, the {service_name} service is not supported by this version of LocalStack, but is available if you upgrade to the latest stable version."
×
32
            error_code = 2
×
33
        else:
34
            message = f"Sorry, the {operation_name} operation on the {service_name} service is not supported by this version of LocalStack, but is available if you upgrade to the latest stable version."
×
35
            error_code = 6
×
36
        super().__init__(message, error_code)
×
37

38

39
class LicenseUpgradeRequiredException(AwsServiceAvailabilityException):
1✔
40
    def __init__(self, service_name: str, operation_name: str | None = None):
1✔
41
        if operation_name is None:
1✔
42
            message = f"Sorry, the {service_name} service is not included within your LocalStack license, but is available in an upgraded license. Please refer to {_DOCS_COVERAGE_URL} for more details."
1✔
43
            error_code = 1
1✔
44
        else:
UNCOV
45
            message = f"Sorry, the {operation_name} operation on the {service_name} service is not supported with your LocalStack license. Please refer to {_DOCS_COVERAGE_URL} for more details."
×
UNCOV
46
            error_code = 5
×
47
        super().__init__(message, error_code)
1✔
48

49

50
def get_service_availability_exception(
1✔
51
    service_name: str,
52
    operation_name: str | None,
53
    status: AwsServicesSupportInLatest | AwsServiceOperationsSupportInLatest | None,
54
) -> AwsServiceAvailabilityException:
55
    match status:
1✔
56
        case AwsServicesSupportInLatest.SUPPORTED:
1✔
57
            return LatestVersionRequiredException(service_name)
×
58
        case AwsServiceOperationsSupportInLatest.SUPPORTED:
1✔
UNCOV
59
            return LatestVersionRequiredException(service_name, operation_name)
×
60
        case (
1✔
61
            AwsServicesSupportInLatest.SUPPORTED_WITH_LICENSE_UPGRADE
62
            | AwsServiceSupportAtRuntime.AVAILABLE_WITH_LICENSE_UPGRADE
63
        ):
64
            return LicenseUpgradeRequiredException(service_name)
1✔
65
        case AwsServiceOperationsSupportInLatest.SUPPORTED_WITH_LICENSE_UPGRADE:
1✔
UNCOV
66
            return LicenseUpgradeRequiredException(service_name, operation_name)
×
67
        case AwsServicesSupportInLatest.NOT_SUPPORTED | AwsServiceSupportAtRuntime.NOT_IMPLEMENTED:
1✔
68
            return ServiceOrOperationNotSupportedException(service_name, operation_name)
1✔
69
        case _:
1✔
70
            return AwsServiceAvailabilityException(
1✔
71
                message=f"The API for service {service_name} is either not included in your current license plan or has not yet been emulated by LocalStack.",
72
                error_code=4,
73
            )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc