forked from Bandwidth/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_exception.py
More file actions
33 lines (23 loc) · 884 Bytes
/
api_exception.py
File metadata and controls
33 lines (23 loc) · 884 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
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
"""
bandwidth
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class APIException(Exception):
"""Class that handles HTTP Exceptions when fetching API Endpoints.
Attributes:
response_code (int): The status code of the response.
response (HttpResponse): The HttpResponse of the API call.
"""
def __init__(self,
reason,
response):
"""Constructor for the APIException class
Args:
reason (string): The reason (or error message) for the Exception
to be raised.
response (HttpResponse): The HttpResponse of the API call.
"""
super(APIException, self).__init__(reason)
self.response = response
self.response_code = response.status_code