Skip to content

Instantly share code, notes, and snippets.

@filipeximenes
Last active September 16, 2015 16:55
Show Gist options
  • Save filipeximenes/d67eb6e875ea6c3c34cd to your computer and use it in GitHub Desktop.
Save filipeximenes/d67eb6e875ea6c3c34cd to your computer and use it in GitHub Desktop.
from tapioca.exceptions import ClientError, ServerError
from my_wrapper import MyWrapper
api = MyWrapper()
try:
r = api.my_resource().post(data={'test': 'data'})
except ClientError as e:
print('This is a client error with status code %s' % e.client().response().status_code)
except ServerError as e:
print('This is a server error with status code %s' % e.client().response().status_code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment