forked from flowroute/flowroute-messaging-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexception.py
More file actions
26 lines (20 loc) · 804 Bytes
/
exception.py
File metadata and controls
26 lines (20 loc) · 804 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
25
26
# -*- coding: utf-8 -*-
"""FlowrouteMessagingLib.APIException
Copyright Flowroute, Inc. 2016
"""
class FlowrouteException(Exception):
"""Class that handles HTTP Exceptions when fetching API Endpoints.
Attributes:
reason (str):
The reason (or error message) for the Exception
to be raised.
response_code (int):
The HTTP Response Code from the API Request that
caused this exception to be raised.
response_body (str):
The body that was retrieved during the API request.
"""
def __init__(self, reason: str, response_code: int, response_body: str):
Exception.__init__(self, reason)
self.response_code = response_code
self.response_body = response_body