mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Refactor error handling to use anyhow throughout codebase
Switch all custom error types and handler signatures from `Box<dyn std::error::Error + Send + Sync>` to `anyhow::Result`. Add anyhow as a dependency. Fix typos and update function names for consistency.
This commit is contained in:
@@ -40,7 +40,7 @@ async fn generic_search_pagination_handler<T, P, Fut>(
|
||||
where
|
||||
T: Format + Clone + Debug,
|
||||
P: FormatTitle + Clone + Debug,
|
||||
Fut: std::future::Future<Output = Result<Page<T, P>, Box<dyn std::error::Error + Send + Sync>>>,
|
||||
Fut: std::future::Future<Output = anyhow::Result<Page<T, P>>>,
|
||||
{
|
||||
let chat_id = cq.chat_id();
|
||||
let user_id = cq.from.id;
|
||||
@@ -106,11 +106,11 @@ where
|
||||
};
|
||||
}
|
||||
|
||||
let formated_page = items_page.format(page, 4096);
|
||||
let formatted_page = items_page.format(page, 4096);
|
||||
|
||||
let keyboard = generic_get_pagination_keyboard(page, items_page.pages, search_data, true);
|
||||
|
||||
bot.edit_message_text(chat_id, message_id, formated_page)
|
||||
bot.edit_message_text(chat_id, message_id, formatted_page)
|
||||
.reply_markup(keyboard)
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user