SiftScience / sift-python

Sift API (Python client)
MIT License
20 stars 23 forks source link

track, label, etc #30

Closed ubaldo closed 8 years ago

ubaldo commented 9 years ago

all this methods return the requests.exceptions.RequestException exception instead of re raising it. Is it intended to be that way, it makes for very impractical API consumption

fredsadaghiani commented 8 years ago

Hrm... good point. Perhaps we should just pass?

zackkitzmiller commented 8 years ago

I think it would be ideal to define Sift exception types in this library and not expose requests exceptions to the caller. This makes catching them require the caller either 1. import requests or 2. catch naked/unnamed exceptions.

I'm much prefer to do something like

try:
    client.XXX
except sift.ReadTimeout
   # handle here

If this is interest in this I could propose a PR.

fredsadaghiani commented 8 years ago

Yeah, I like that. Please do!

zackkitzmiller commented 8 years ago

@fredsadaghiani Sounds good. Might take me a couple of days to get to it.

fredsadaghiani commented 8 years ago

@zackkitzmiller FYI, for now I've updated the code to swallow exceptions. See https://github.com/SiftScience/sift-python/pull/34