kcode-tg-kennedy-bot 0.5.2

A host-integrated Telegram transport, durable queue, and fail-closed group-security library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub(super) use kcode_telegram_request_policy::{
    request_error_class, retry_download, retry_request,
};

pub(super) fn anyhow_error_class(error: &anyhow::Error) -> &'static str {
    for cause in error.chain() {
        if let Some(sqlite_error) = cause.downcast_ref::<rusqlite::Error>() {
            return match sqlite_error {
                rusqlite::Error::SqliteFailure(_, _) => "sqlite_failure",
                rusqlite::Error::QueryReturnedNoRows => "sqlite_not_found",
                rusqlite::Error::InvalidQuery => "sqlite_invalid_query",
                _ => "sqlite_other",
            };
        }
    }
    kcode_telegram_request_policy::anyhow_error_class(error)
}