forked from aws-powertools/powertools-lambda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
24 lines (18 loc) · 709 Bytes
/
Copy pathexceptions.py
File metadata and controls
24 lines (18 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations
class UnauthorizedException(Exception):
"""
Error to be thrown to communicate the subscription is unauthorized.
When this error is raised, the client will receive a 40x error code
and the subscription will be closed.
Attributes:
message (str): The error message describing the unauthorized access.
"""
def __init__(self, message: str | None = None, *args):
"""
Initialize the UnauthorizedException.
Args:
message (str): A descriptive error message.
*args: Variable positional arguments.
"""
super().__init__(message, *args)
self.name = "UnauthorizedException"