Skip to content

Commit b63353d

Browse files
committed
chore: This is also an indication of an expired token. Refs #1345
1 parent 7da64d7 commit b63353d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exchangelib/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import requests.exceptions
2020
from defusedxml.expatreader import DefusedExpatParser
2121
from defusedxml.sax import _InputSource
22-
from oauthlib.oauth2 import TokenExpiredError
22+
from oauthlib.oauth2 import InvalidClientIdError, TokenExpiredError
2323
from pygments import highlight
2424
from pygments.formatters.terminal import TerminalFormatter
2525
from pygments.lexers.html import XmlLexer
@@ -831,7 +831,7 @@ def post_ratelimited(protocol, session, url, headers, data, stream=False, timeou
831831
protocol.retire_session(session)
832832
log.debug("Session %s thread %s: connection error POST'ing to %s", session.session_id, thread_id, url)
833833
raise ErrorTimeoutExpired(f"Reraised from {e.__class__.__name__}({e})")
834-
except TokenExpiredError:
834+
except (InvalidClientIdError, TokenExpiredError):
835835
log.debug("Session %s thread %s: OAuth token expired; refreshing", session.session_id, thread_id)
836836
protocol.release_session(protocol.refresh_credentials(session))
837837
raise

0 commit comments

Comments
 (0)