From ccbf23891b5e683203be2940da4cd020d6c66582 Mon Sep 17 00:00:00 2001 From: Bofh Date: Mon, 8 Feb 2021 21:20:28 +0100 Subject: [PATCH] Added better error handling on delete status --- igmirror.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/igmirror.py b/igmirror.py index 74bbce1..b51eb66 100644 --- a/igmirror.py +++ b/igmirror.py @@ -98,10 +98,13 @@ def delete_statuses(acc_id): # check our information to validate our account exists r = requests.get( 'https://'+config()['instance']+'/api/pixelfed/v1/accounts/verify_credentials', cookies=accdata['cookie']) + if r.status_code != 200: + print('E| user "{}" is not logged in. Please log in'.format(acc_id)) + return 2 pixdata = json.loads(r.text) if not 'id' in pixdata: print('E| fatal! API is not working!. Might be a connectivity issue or the Account does Not Exist??'.format(acc_id)) - return 2 + return 3 _, _token = pixelfed_token_url('', accdata['cookie']) _headers = {