fix: Refine the confusing error message.

PiperOrigin-RevId: 757841288
This commit is contained in:
Shangjie Chen 2025-05-12 11:20:18 -07:00 committed by Copybara-Service
parent 847c8fd11a
commit c39f24f072

View File

@ -484,11 +484,12 @@ class DatabaseSessionService(BaseSessionService):
if storage_session.update_time.timestamp() > session.last_update_time:
raise ValueError(
f"Session last_update_time "
f"{datetime.fromtimestamp(session.last_update_time):%Y-%m-%d %H:%M:%S} "
f"is later than the update_time in storage "
f"{storage_session.update_time:%Y-%m-%d %H:%M:%S}"
)
"The last_update_time provided in the session object"
f" {datetime.fromtimestamp(session.last_update_time):'%Y-%m-%d %H:%M:%S'} is"
" earlier than the update_time in the storage_session"
f" {storage_session.update_time:'%Y-%m-%d %H:%M:%S'}. Please check"
" if it is a stale session."
)
# Fetch states from storage
storage_app_state = sessionFactory.get(