★ wanayoo — archive 1999 https://github.com/segmentio/analytics-python/issues/104Nouvelle recherche | Portail wanayoo
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

Incorrect order or args to APIError #104

Open
jklukas opened this issue Feb 16, 2018 · 3 comments
Open

Incorrect order or args to APIError #104

jklukas opened this issue Feb 16, 2018 · 3 comments
Labels

Comments

@jklukas
Copy link

@jklukas jklukas commented Feb 16, 2018

See

raise APIError(res.status_code, 'unknown', res.text)

In that line, the order or arguments to APIError is incorrect, leading to actual error messages looking like:

ERROR:segment:error uploading: [Segment] unknown: Bad Request
 (400)

What's expected is probably:

ERROR:segment:error uploading: [Segment] 400: Bad Request (unknown)
@f2prateek
Copy link
Member

@f2prateek f2prateek commented Feb 16, 2018

Ah yep, that looks like a typo to me. The constructor is declared as def __init__(self, status, code, message):. I've triaged this internally in our JIRA board, https://segment.atlassian.net/browse/LIB-250; we'll post back here when there's an update!

@jklukas
Copy link
Author

@jklukas jklukas commented Feb 16, 2018

Thanks, @f2prateek !

@GautamGupta
Copy link

@GautamGupta GautamGupta commented Jun 26, 2018

The log format would actually work just fine for the other use case:

raise APIError(res.status_code, payload['code'], payload['message'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.