Retry errors when getting file labels

This commit is contained in:
Ross Scroggs
2024-06-05 12:22:48 -07:00
parent cb00e6de9f
commit 100df45d46
6 changed files with 36 additions and 15 deletions

View File

@@ -15,6 +15,15 @@ gam <UserTypeEntity> delete|remove chatmember asadmin
gam <UserTypeEntity> print|show chatmembers|asadmin
```
6.76.13
Updated `gam <UserTypeEntity> show fileinfo ... showlabels` and `gam <UserTypeEntity> print filelist ... showlabels`
to retry these errors that occur when trying to get the drive labels for a file/folder.
```
ERROR: 500: unknownError - Unknown Error.
ERROR: 503: serviceNotAvailable - The service is currently unavailable.
```
6.76.12
Fixed bug in `gam <UserTypeEntity> print|show chatspaces` that caused the following error:

View File

@@ -52445,6 +52445,7 @@ def showFileInfo(users):
if showLabels is not None:
labels = callGAPIitems(drive.files(), 'listLabels', 'labels',
throwReasons=GAPI.DRIVE_GET_THROW_REASONS,
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.UNKNOWN_ERROR],
fileId=fileId)
_formatFileDriveLabels(showLabels, labels, result, False, ' ')
if not FJQC.formatJSON:
@@ -53948,6 +53949,7 @@ def printFileList(users):
if showLabels is not None:
labels = callGAPIitems(drive.files(), 'listLabels', 'labels',
throwReasons=GAPI.DRIVE_GET_THROW_REASONS,
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.UNKNOWN_ERROR],
fileId=childFileId)
_formatFileDriveLabels(showLabels, labels, childEntryInfo, True, delimiter)
if filepath:
@@ -54259,6 +54261,7 @@ def printFileList(users):
for f_file in files:
labels = callGAPIitems(drive.files(), 'listLabels', 'labels',
throwReasons=GAPI.DRIVE_GET_THROW_REASONS,
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.UNKNOWN_ERROR],
fileId=f_file['id'])
_formatFileDriveLabels(showLabels, labels, f_file, True, delimiter)
if not incrementalPrint:
@@ -54315,6 +54318,7 @@ def printFileList(users):
if showLabels is not None:
labels = callGAPIitems(drive.files(), 'listLabels', 'labels',
throwReasons=GAPI.DRIVE_GET_THROW_REASONS,
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS+[GAPI.UNKNOWN_ERROR],
fileId=fileId)
_formatFileDriveLabels(showLabels, labels, fileEntryInfo, True, delimiter)
if filepath: