File: exceptions.py

package info (click to toggle)
python-moto 5.1.18-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 116,520 kB
  • sloc: python: 636,725; javascript: 181; makefile: 39; sh: 3
file content (88 lines) | stat: -rw-r--r-- 2,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from typing import Any

from moto.core.exceptions import ServiceException


class ELBClientError(ServiceException):
    pass


class DuplicateTagKeysError(ELBClientError):
    def __init__(self, cidr: Any):
        super().__init__(
            "DuplicateTagKeys", f"Tag key was specified more than once: {cidr}"
        )


class CertificateNotFoundException(ELBClientError):
    def __init__(self) -> None:
        super().__init__(
            "CertificateNotFoundException", "Supplied certificate was not found"
        )


class LoadBalancerNotFoundError(ELBClientError):
    def __init__(self, name: str):
        super().__init__(
            "LoadBalancerNotFound",
            f"The specified load balancer does not exist: {name}",
        )


class NoActiveLoadBalancerFoundError(ELBClientError):
    def __init__(self, name: str):
        super().__init__(
            "LoadBalancerNotFound", f"There is no ACTIVE Load Balancer named '{name}'"
        )


class PolicyNotFoundError(ELBClientError):
    def __init__(self) -> None:
        super().__init__(
            "PolicyNotFound", "There is no policy with name . for load balancer ."
        )


class TooManyTagsError(ELBClientError):
    def __init__(self) -> None:
        super().__init__(
            "LoadBalancerNotFound",
            "The quota for the number of tags that can be assigned to a load balancer has been reached",
        )


class BadHealthCheckDefinition(ELBClientError):
    def __init__(self) -> None:
        super().__init__(
            "ValidationError",
            "HealthCheck Target must begin with one of HTTP, TCP, HTTPS, SSL",
        )


class DuplicateListenerError(ELBClientError):
    def __init__(self, name: str, port: str):
        super().__init__(
            "DuplicateListener",
            f"A listener already exists for {name} with LoadBalancerPort {port}, but with a different InstancePort, Protocol, or SSLCertificateId",
        )


class DuplicateLoadBalancerName(ELBClientError):
    def __init__(self, name: str):
        super().__init__(
            "DuplicateLoadBalancerName",
            f"The specified load balancer name already exists for this account: {name}",
        )


class EmptyListenersError(ELBClientError):
    def __init__(self) -> None:
        super().__init__("ValidationError", "Listeners cannot be empty")


class InvalidSecurityGroupError(ELBClientError):
    def __init__(self) -> None:
        super().__init__(
            "ValidationError",
            "One or more of the specified security groups do not exist.",
        )