mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-05 05:11:35 +00:00
cleanup
This commit is contained in:
@@ -1081,6 +1081,12 @@ def getValidOauth2TxtCredentials(force_refresh=False):
|
|||||||
writeCredentials(credentials)
|
writeCredentials(credentials)
|
||||||
break
|
break
|
||||||
except google.auth.exceptions.RefreshError as e:
|
except google.auth.exceptions.RefreshError as e:
|
||||||
|
try:
|
||||||
|
if e.args[0] in REFRESH_PERM_ERRORS:
|
||||||
|
# remove OAuth file so we kick off auth next time
|
||||||
|
os.remove(GC_Values[GC_OAUTH2_TXT])
|
||||||
|
except SyntaxError:
|
||||||
|
pass
|
||||||
controlflow.system_error_exit(18, str(e))
|
controlflow.system_error_exit(18, str(e))
|
||||||
except (google.auth.exceptions.TransportError, httplib2.ServerNotFoundError, RuntimeError) as e:
|
except (google.auth.exceptions.TransportError, httplib2.ServerNotFoundError, RuntimeError) as e:
|
||||||
if n != retries:
|
if n != retries:
|
||||||
|
|||||||
@@ -450,6 +450,11 @@ DOCUMENT_FORMATS_MAP = {
|
|||||||
{'mime': 'application/vnd.oasis.opendocument.text', 'ext': '.odt'}],
|
{'mime': 'application/vnd.oasis.opendocument.text', 'ext': '.odt'}],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REFRESH_PERM_ERRORS = [
|
||||||
|
'invalid_grant: reauth related error (rapt_required)', # no way to reauth today
|
||||||
|
'invalid_grant: Token has been expired or revoked.',
|
||||||
|
]
|
||||||
|
|
||||||
DNS_ERROR_CODES_MAP = {
|
DNS_ERROR_CODES_MAP = {
|
||||||
1: 'DNS Query Format Error',
|
1: 'DNS Query Format Error',
|
||||||
2: 'Server failed to complete the DNS request',
|
2: 'Server failed to complete the DNS request',
|
||||||
|
|||||||
Reference in New Issue
Block a user