Skip to content

Conversation

@rambobinator
Copy link
Contributor

No description provided.

"""
valid_response = False
raw = kwargs.pop("raw", False)
custom_exception_handlers = kwargs.pop("custom_exception_handlers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
custom_exception_handlers = kwargs.pop("custom_exception_handlers")
custom_exception_handlers = kwargs.pop("custom_exception_handlers", None)

raise self.error_codes[error_code](response)
if "error_code" in data or "error_id" in data:
raise AppNexusException(response)
raise type(data["error_id"], (AppNexusException,), {})(response)
Copy link
Contributor

@ramnes ramnes Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create a new type if we catch it right after. Let's remove that method and check the "error_id" directly in an handle_errors method.


def _exception_handler(self, exception,
response, data,
custom_handler=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handlers*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants