refactor: Add exception handling to Apple migration commands (#32500)

* refactor: Add exception handling to Apple migration commands

* refactor: Remove extra import
This commit is contained in:
Moeez Zahid
2023-06-19 14:07:24 +05:00
committed by GitHub
parent 23fa9248de
commit 2d1a6e27fc
2 changed files with 6 additions and 0 deletions

View File

@@ -148,6 +148,9 @@ class Command(BaseCommand):
except BadRequestException:
log.info('Bad request for uid %s.', apple_id)
transfer_id = ''
except (requests.exceptions.JSONDecodeError, AttributeError):
log.info('JSONDecodeError/AttributeError for uid %s.', apple_id)
transfer_id = ''
return transfer_id

View File

@@ -145,6 +145,9 @@ class Command(BaseCommand):
except BadRequestException:
log.info('Bad request for transfer_id %s.', transfer_id)
new_apple_id = ''
except (requests.exceptions.JSONDecodeError, AttributeError):
log.info('JSONDecodeError/AttributeError for transfer_id %s.', transfer_id)
transfer_id = ''
return new_apple_id