Added better error handling on delete status
This commit is contained in:
parent
6db3fad9e3
commit
ccbf23891b
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue