Skip to content

Commit 15d1bde

Browse files
authored
Merge pull request #55 from opsgenie/Issue-50-python-sdk
Adding Exception Reason for 502,504 and default exception
2 parents bb718ae + cf844c4 commit 15d1bde

File tree

8 files changed

+12
-10
lines changed

8 files changed

+12
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
44

55
- API version: 2.0.0
6-
- Package version: 2.1.3
6+
- Package version: 2.1.4
77
- Build package: com.atlassian.opsgenie.codegen.geniepy.GeniepyGenerator
88

99
For more information, please visit [https://www.opsgenie.com/contact-us](https://www.opsgenie.com/contact-us)

opsgenie_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
from opsgenie_sdk.models.weekday_time_restriction_interval import WeekdayTimeRestrictionInterval
169169
from opsgenie_sdk.models.weekday_time_restriction_interval_all_of import WeekdayTimeRestrictionIntervalAllOf
170170

171-
__version__ = "2.1.3"
171+
__version__ = "2.1.4"
172172

173173
# import apis into sdk package
174174

opsgenie_sdk/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
8888
self.default_headers[header_name] = header_value
8989
self.cookie = cookie
9090
# Set default User-Agent.
91-
self.user_agent = 'opsgenie-sdk-python-2.1.3'
91+
self.user_agent = 'opsgenie-sdk-python-2.1.4'
9292

9393
# init metric publishers
9494
self.http_metric_publisher = self.rest_client.http_metric

opsgenie_sdk/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def to_debug_report(self):
252252
"OS: {env}\n"\
253253
"Python Version: {pyversion}\n"\
254254
"Version of the API: 2.0.0\n"\
255-
"SDK Package Version: 2.1.3".\
255+
"SDK Package Version: 2.1.4".\
256256
format(env=sys.platform, pyversion=sys.version)
257257

258258
def get_host_settings(self):

opsgenie_sdk/exceptions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,10 @@ def build_exception(response):
230230
429: ApiException(reason="Throttling"),
231231
500: ServerErrorException(reason="Internal Server Error"),
232232
501: ServerErrorException(reason="Not Implemented"),
233+
502: ServerErrorException(reason="Bad Gateway"),
233234
503: ServerErrorException(reason="Back-end servers are at capacity"),
234-
-100: ApiException()
235-
}.get(http_error_code, -100)
235+
504: ServerErrorException(reason="Gateway Timeout")
236+
}.get(http_error_code, ApiException(reason="API Encountered a Problem"))
236237

237238
exception.status = response.status
238239
exception.reason = response.reason + ": " + exception.reason

scripts/sdk/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"packageName": "opsgenie_sdk",
33
"projectName": "opsgenie-sdk",
4-
"packageVersion": "2.1.3",
4+
"packageVersion": "2.1.4",
55
"packageUrl": "https://github.com/opsgenie/opsgenie-python-sdk",
66
"sortParamsByRequiredFlag": "true",
77
"hideGenerationTimestamp": "true",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from setuptools import setup, find_packages # noqa: H301
1717

1818
NAME = "opsgenie-sdk"
19-
VERSION = "2.1.3"
19+
VERSION = "2.1.4"
2020
# To install the library, run the following
2121
#
2222
# python setup.py install

templates/exceptions.mustache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ def build_exception(response):
221221
429: ApiException(reason="Throttling"),
222222
500: ServerErrorException(reason="Internal Server Error"),
223223
501: ServerErrorException(reason="Not Implemented"),
224+
502: ServerErrorException(reason="Bad Gateway"),
224225
503: ServerErrorException(reason="Back-end servers are at capacity"),
225-
-100: ApiException()
226-
}.get(http_error_code, -100)
226+
504: ServerErrorException(reason="Gateway Timeout")
227+
}.get(http_error_code, ApiException(reason="API Encountered a Problem"))
227228

228229
exception.status = response.status
229230
exception.reason = response.reason + ": " + exception.reason

0 commit comments

Comments
 (0)