From 43b1f8445a8dbfed1a6fe9c8b5a3575d79ff2292 Mon Sep 17 00:00:00 2001 From: Waffle Maybe Date: Sat, 2 Mar 2024 21:30:13 +0100 Subject: [PATCH] improve `ApiError::TerminatedByOtherGetUpdates` docs --- crates/teloxide-core/src/errors.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/teloxide-core/src/errors.rs b/crates/teloxide-core/src/errors.rs index 08d140e8..50bc6930 100644 --- a/crates/teloxide-core/src/errors.rs +++ b/crates/teloxide-core/src/errors.rs @@ -677,13 +677,19 @@ impl_api_error! { /// [`SendMessage`]: crate::payloads::SendMessage WrongHttpUrl = "Bad Request: wrong HTTP URL", - /// Occurs when bot tries GetUpdate before the timeout. Make sure that only - /// one Updater is running. + /// Occurs when multiple [`GetUpdates`] calls happen at the same time. + /// + /// This can happen if + /// 1. You are running multiple bot instances + /// 2. You are running multiple update consumers (like [`Dispatcher`] or [`repl`]) + /// 3. You are calling [`GetUpdates`] yourself and the second call is done before the first one finishes /// /// May happen in methods: /// 1. [`GetUpdates`] /// /// [`GetUpdates`]: crate::payloads::GetUpdates + /// [`Dispatcher`]: crate::dispatching::Dispatcher + /// [`repl`]: crate::repl TerminatedByOtherGetUpdates = "Conflict: terminated by other getUpdates request; make sure that only one bot instance \ is running",