box-python-sdk icon indicating copy to clipboard operation
box-python-sdk copied to clipboard

Catch Network exceptions and surface them as Box SDK exceptions

Open jmoldow opened this issue 6 years ago • 5 comments

Right now, our use of requests isn't invisible because we don't catch requests exceptions. This means that the user has to either catch requests exceptions too, or these could crash their program.

jmoldow avatar May 25 '18 21:05 jmoldow

@jmoldow How can I catch request exception?

I'm seeing request exception message like below while catching BoxAPIException.

"POST https://api.box.com/2.0/folders" 409 312
{'Date': 'Tue, 18 Jun 2019 07:42:42 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Strict-Transport-Security': 'max-age=31536000', 'Cache-Control': 'no-cache, no-store', 'Content-Encoding': 'gzip', 'Vary': 'Accept-Encoding', 'BOX-REQUEST-ID': '0ehidqbgqof5tssmbtrkntj3rti'}

I'm using SDK version 2.4.1.

bts-dido avatar Jun 18 '19 08:06 bts-dido

@jmoldow @mattwiller Any update?

bts-dido avatar Jun 20 '19 05:06 bts-dido

@bts-dido Is the issue here that you're seeing the logged error response? If so, you may find the information over at https://github.com/box/box-python-sdk/issues/414 helpful

mattwiller avatar Jun 21 '19 00:06 mattwiller

Thanks @mattwiller ! That helped.

bts-dido avatar Jun 21 '19 05:06 bts-dido

@bts-dido Great — glad to hear it!

mattwiller avatar Jun 21 '19 05:06 mattwiller

This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.

stale[bot] avatar Dec 19 '22 20:12 stale[bot]

This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.

stale[bot] avatar Dec 27 '22 06:12 stale[bot]