Skip to content

Commit cf4473f

Browse files
Merge pull request #3 from interakt/develop
Resolved API Error bug
2 parents e0f5a30 + 8b04293 commit cf4473f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The `identify` lets you tie a user to their actions and record traits about them
5353
Example `identify` call:
5454
```
5555
track.identify(
56-
user_id="<USER_ID>",
56+
user_id="<user_id in your db>",
5757
traits={
5858
"name": "John Doe",
5959
"email": "john@email.com",
@@ -76,19 +76,19 @@ The `identify` call has the following fields:
7676

7777

7878

79-
8079
## Event
8180
`event` track API lets you record the actions your users perform. Every action triggers what we call an “event”, which can also have associated properties.
8281

8382
Example `event` call:
8483
```
8584
track.event(
86-
user_id="changu_mangu",
85+
user_id="<user_id in your db>",
8786
event="Product Added",
8887
traits={"price": 200}
8988
)
9089
```
9190
The `event` call has the following fields:
91+
9292
|Field|Data type|Description|
9393
|--|--|--|
9494
|user_id|str or int|The ID for the user in your database.|

track/consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def fatal_exception(exc):
6969
# retry on server errors and client errors
7070
# with 429 status code (rate limited),
7171
# don't retry on other client errors
72-
return (400 <= exc.status < 500) and exc.status != 429
72+
return (400 <= exc.status_code < 500) and exc.status_code != 429
7373
else:
7474
# retry on all other errors (eg. network)
7575
return False

track/request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def post(write_key, host=None, path=None, body=None, timeout=10):
3737

3838
class APIError(Exception):
3939

40-
def __init__(self, status, code, message):
40+
def __init__(self, status, status_code, message):
4141
self.message = message
4242
self.status = status
43-
self.code = code
43+
self.status_code = status_code
4444

4545
def __str__(self):
4646
msg = "[interakt-track] StatusCode({0}): {1} (Success={2})"
47-
return msg.format(self.code, self.message, self.status)
47+
return msg.format(self.status_code, self.message, self.status)

track/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.0.0'
1+
VERSION = '1.0.1'

0 commit comments

Comments
 (0)