forked from flowroute/flowroute-messaging-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPIException.py
More file actions
26 lines (20 loc) · 778 Bytes
/
APIException.py
File metadata and controls
26 lines (20 loc) · 778 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 APIException(Exception):
"""
Class that handles HTTP Exceptions when fetching API Endpoints.
Attributes:
reason (string): 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 (string): The body that was retrieved during the API
request.
"""
def __init__(self, reason, response_code, response_body):
Exception.__init__(self, reason)
self.response_code = response_code
self.response_body = response_body