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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user