8000 fix: Refine the confusing error message. · codefromthecrypt/adk-python@c39f24f · GitHub
[go: up one dir, main page]

Skip to content

Commit c39f24f

Browse files
DeanChensjcopybara-github
authored andcommitted
fix: Refine the confusing error message.
PiperOrigin-RevId: 757841288
1 parent 847c8fd commit c39f24f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/google/adk/sessions/database_session_service.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,12 @@ def append_event(self, session: Session, event: Event) -> Event:
484484

485485
if storage_session.update_time.timestamp() > session.last_update_time:
486486
raise ValueError(
487-
f"Session last_update_time "
488-
f"{datetime.fromtimestamp(session.last_update_time):%Y-%m-%d %H:%M:%S} "
489-
f"is later than the update_time in storage "
490-
f"{storage_session.update_time:%Y-%m-%d %H:%M:%S}"
491-
)
487+
"The last_update_time provided in the session object"
488+
f" {datetime.fromtimestamp(session.last_update_time):'%Y-%m-%d %H:%M:%S'} is"
489+
" earlier than the update_time in the storage_session"
490+
f" {storage_session.update_time:'%Y-%m-%d %H:%M:%S'}. Please check"
491+
" if it is a stale session."
492+
)
492493

493494
# Fetch states from storage
494495
storage_app_state = sessionFactory.get(

0 commit comments

Comments
 (0)
0