aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2017-04-25 11:36:49 +0200
committerLorenz Diener <[email protected]>2017-04-25 11:36:49 +0200
commit5aeb953d24917feae9c18cb5f2ae505ab731244a (patch)
tree4b89f3745d6138f8b3b9d95ed58a61f589d4aa3f /mastodon/Mastodon.py
parent6f48c154310a5a154a051a793690d973617016c0 (diff)
downloadmastodon.py-5aeb953d24917feae9c18cb5f2ae505ab731244a.tar.gz
Remove additional traceback print
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py12
1 files changed, 0 insertions, 12 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 93407e6..2eaec49 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -67,8 +67,6 @@ class Mastodon:
67 response = requests.post(api_base_url + '/api/v1/apps', data = request_data, timeout = request_timeout) 67 response = requests.post(api_base_url + '/api/v1/apps', data = request_data, timeout = request_timeout)
68 response = response.json() 68 response = response.json()
69 except Exception as e: 69 except Exception as e:
70 import traceback
71 traceback.print_exc()
72 raise MastodonNetworkError("Could not complete request: %s" % e) 70 raise MastodonNetworkError("Could not complete request: %s" % e)
73 71
74 if to_file != None: 72 if to_file != None:
@@ -219,8 +217,6 @@ class Mastodon:
219 self.refresh_token = response.get('refresh_token') 217 self.refresh_token = response.get('refresh_token')
220 self.token_expired = int(response.get('expires_in', 0)) 218 self.token_expired = int(response.get('expires_in', 0))
221 except Exception as e: 219 except Exception as e:
222 import traceback
223 traceback.print_exc()
224 if username is not None or password is not None: 220 if username is not None or password is not None:
225 raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e) 221 raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
226 elif code is not None: 222 elif code is not None:
@@ -505,8 +501,6 @@ class Mastodon:
505 else: 501 else:
506 media_ids_proper.append(media_id) 502 media_ids_proper.append(media_id)
507 except Exception as e: 503 except Exception as e:
508 import traceback
509 traceback.print_exc()
510 raise MastodonIllegalArgumentError("Invalid media dict: %s" % e) 504 raise MastodonIllegalArgumentError("Invalid media dict: %s" % e)
511 505
512 params_initial["media_ids"] = media_ids_proper 506 params_initial["media_ids"] = media_ids_proper
@@ -763,8 +757,6 @@ class Mastodon:
763 if method == 'DELETE': 757 if method == 'DELETE':
764 response_object = requests.delete(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout) 758 response_object = requests.delete(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout)
765 except Exception as e: 759 except Exception as e:
766 import traceback
767 traceback.print_exc()
768 raise MastodonNetworkError("Could not complete request: %s" % e) 760 raise MastodonNetworkError("Could not complete request: %s" % e)
769 761
770 if response_object == None: 762 if response_object == None:
@@ -785,8 +777,6 @@ class Mastodon:
785 try: 777 try:
786 response = response_object.json() 778 response = response_object.json()
787 except: 779 except:
788 import traceback
789 traceback.print_exc()
790 raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content)) 780 raise MastodonAPIError("Could not parse response as JSON, response code was %s, bad json content was '%s'" % (response_object.status_code, response_object.content))
791 781
792 # Handle rate limiting 782 # Handle rate limiting
@@ -805,8 +795,6 @@ class Mastodon:
805 self.ratelimit_reset += server_time_diff 795 self.ratelimit_reset += server_time_diff
806 self.ratelimit_lastcall = time.time() 796 self.ratelimit_lastcall = time.time()
807 except Exception as e: 797 except Exception as e:
808 import traceback
809 traceback.print_exc()
810 raise MastodonRatelimitError("Rate limit time calculations failed: %s" % e) 798 raise MastodonRatelimitError("Rate limit time calculations failed: %s" % e)
811 799
812 if "error" in response and response["error"] == "Throttled": 800 if "error" in response and response["error"] == "Throttled":
Powered by cgit v1.2.3 (git 2.41.0)