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

localstack / localstack / 19656300538

24 Nov 2025 06:52PM UTC coverage: 86.867% (-0.01%) from 86.879%
19656300538

push

github

web-flow
CFn: validate conditions exist in Fn::If (#13243)

3 of 4 new or added lines in 1 file covered. (75.0%)

236 existing lines in 7 files now uncovered.

68861 of 79272 relevant lines covered (86.87%)

0.87 hits per line

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

85.0
/localstack-core/localstack/aws/handlers/fallback.py
1
"""Handlers for fallback logic, e.g., populating empty requests or defaulting with default exceptions."""
2

3
import logging
1✔
4

5
from rolo.gateway.handlers import EmptyResponseHandler
1✔
6
from werkzeug.exceptions import HTTPException
1✔
7

8
from localstack.http import Response
1✔
9

10
from ..api import RequestContext
1✔
11
from ..chain import ExceptionHandler, HandlerChain
1✔
12

13
__all__ = ["EmptyResponseHandler", "InternalFailureHandler"]
1✔
14

15
LOG = logging.getLogger(__name__)
1✔
16

17

18
class InternalFailureHandler(ExceptionHandler):
1✔
19
    """
20
    Exception handler that returns a generic error message if there was an exception and there is no response set yet.
21
    """
22

23
    def __call__(
1✔
24
        self,
25
        chain: HandlerChain,
26
        exception: Exception,
27
        context: RequestContext,
28
        response: Response,
29
    ):
30
        if response.data:
1✔
31
            # response already set
32
            return
1✔
33

34
        if isinstance(exception, HTTPException):
1✔
35
            response.status_code = exception.code
1✔
36
            response.headers.update(exception.get_headers())
1✔
37
            response.set_json({"error": exception.name, "message": exception.description})
1✔
38
            return
1✔
39

UNCOV
40
        LOG.debug("setting internal failure response for %s", exception)
×
UNCOV
41
        response.status_code = 500
×
UNCOV
42
        response.set_json(
×
43
            {
44
                "error": "Unexpected exception",
45
                "message": str(exception),
46
                "type": str(exception.__class__.__name__),
47
            }
48
        )
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