dracarys18 / git_release_tracker

A Telegram Bot written in Rust to Track new Github releases
21 stars 6 forks source link

panicked at 'called `Option::unwrap()` on a `None` value' #4

Open ms-jagadeeshan opened 2 years ago

ms-jagadeeshan commented 2 years ago

Bug report

Environment

OS version : 5.13.0-27-generic #29-Ubuntu SMP Wed Jan 12 17:36:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Expecte Behavior

Shouldn't have crashed

Current Behavior

Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/release-track`
We are up to date
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/telegram.rs:59:18

Backtrace

    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/release-track`
We are up to date
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/telegram.rs:59:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::panicking::panic
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
   3: core::option::Option<T>::unwrap
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/option.rs:746:21
   4: release_track::telegram::TelegramClient::can_pin_messages::{{closure}}
             at ./src/telegram.rs:55:37
   5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
   6: release_track::telegram::TelegramClient::send_message::{{closure}}
             at ./src/telegram.rs:100:16
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
   8: release_track::run::{{closure}}
             at ./src/main.rs:46:21
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  10: release_track::main::{{closure}}
             at ./src/main.rs:15:9
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/future/mod.rs:80:19
  12: tokio::park::thread::CachedParkThread::block_on::{{closure}}
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/park/thread.rs:263:54
  13: tokio::coop::with_budget::{{closure}}
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/coop.rs:102:9
  14: std::thread::local::LocalKey<T>::try_with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:399:16
  15: std::thread::local::LocalKey<T>::with
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/thread/local.rs:375:9
  16: tokio::coop::with_budget
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/coop.rs:95:5
  17: tokio::coop::budget
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/coop.rs:72:5
  18: tokio::park::thread::CachedParkThread::block_on
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/park/thread.rs:263:31
  19: tokio::runtime::enter::Enter::block_on
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/runtime/enter.rs:151:13
  20: tokio::runtime::thread_pool::ThreadPool::block_on
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/runtime/thread_pool/mod.rs:73:9
  21: tokio::runtime::Runtime::block_on
             at /home/jaga-matrix/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.16.1/src/runtime/mod.rs:477:43
  22: release_track::main
             at ./src/main.rs:14:5
  23: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
dracarys18 commented 2 years ago

Will look into it ! Time to use a fully fledged telegram framework instead of homemade wrappers.

dracarys18 commented 2 years ago

@ms-jagadeeshan Were you running it on a group or a channel?

ms-jagadeeshan commented 2 years ago

No, just in personal message only