Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add extended error code to exception #121

Merged
merged 1 commit into from
Jul 18, 2016
Merged

Conversation

kai5263499
Copy link
Contributor

@kai5263499 kai5263499 commented Jul 15, 2016

I needed the ability to determine when I should blacklist email addresses that were returning errors from SparkPost's REST API and I discovered that the extended error code was already being returned so this change is simply to add that extended error code to the exception message so that downstream consumers can parse it out with something like

p = re.compile(r'Code: (?P<code>\d+) ')
m = p.search(e_str)
codes = [int(c) for c in m.group('code')]

@coveralls
Copy link

coveralls commented Jul 15, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 5057aa4 on kai5263499:master into b3262a5 on SparkPost:master.

@richleland richleland merged commit 88eddfa into SparkPost:master Jul 18, 2016
@richleland
Copy link
Contributor

Thanks for the contribution @kai5263499!

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