Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/sendgrid/helpers/mail/exceptions.py: 53%
22 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1################################################################
2# Various types of extensible Twilio SendGrid related exceptions
3################################################################
6class SendGridException(Exception):
7 """Wrapper/default SendGrid-related exception"""
8 pass
11class ApiKeyIncludedException(SendGridException):
12 """Exception raised for when Twilio SendGrid API Key included in message text"""
14 def __init__(self,
15 expression="Email body",
16 message="Twilio SendGrid API Key detected"):
17 """Create an exception for when Twilio SendGrid API Key included in message text
19 :param expression: Input expression in which the error occurred
20 :type expression: string
21 :param message: Explanation of the error
22 :type message: string
23 """
24 self._expression = None
25 self._message = None
27 if expression is not None:
28 self.expression = expression
30 if message is not None:
31 self.message = message
33 @property
34 def expression(self):
35 """Input expression in which the error occurred
37 :rtype: string
38 """
39 return self._expression
41 @expression.setter
42 def expression(self, value):
43 """Input expression in which the error occurred
45 :param value: Input expression in which the error occurred
46 :type value: string
47 """
48 self._expression = value
50 @property
51 def message(self):
52 """Explanation of the error
54 :rtype: string
55 """
56 return self._message
58 @message.setter
59 def message(self, value):
60 """Explanation of the error
62 :param value: Explanation of the error
63 :type value: string
64 """
65 self._message = value