Skip to content

Commit 6b0d697

Browse files
committed
fix: improve error messages for time synchronization issues in SecurityCheckMismatch
1 parent 6886e0f commit 6b0d697

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hydrogram/session/session.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,17 @@ async def handle_packet(self, packet):
248248
if time_diff > 30:
249249
raise SecurityCheckMismatch(
250250
"The msg_id belongs to over 30 seconds in the future. "
251-
"Most likely the client time has to be synchronized."
251+
"This usually means your system clock is ahead of the actual time. "
252+
"Please synchronize your system time with an NTP server to avoid "
253+
"this error in Hydrogram."
252254
)
253255

254256
if time_diff < -300:
255257
raise SecurityCheckMismatch(
256258
"The msg_id belongs to over 300 seconds in the past. "
257-
"Most likely the client time has to be synchronized."
259+
"This usually means your system clock is behind the actual time. "
260+
"Please synchronize your system time with an NTP server to avoid "
261+
"this error in Hydrogram."
258262
)
259263
except SecurityCheckMismatch as e:
260264
log.info("Discarding packet: %s", e)

0 commit comments

Comments
 (0)