Skip to content

Conversation

@zonia3000
Copy link

I encountered the following error on application startup:

thread 'main' panicked at src/main.rs:302:82:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: <pineflash::Flasher as eframe::epi::App>::update
   5: <eframe::native::glow_integration::GlowWinitApp as eframe::native::winit_integration::WinitApp>::run_ui_and_paint
   6: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   7: winit::platform_impl::platform::x11::EventLoop<T>::run_on_demand
   8: eframe::run_native
   9: pineflash::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Debugging, I discovered that it was caused by the URL https://api.github.com/repos/Ralim/IronOS/releases replying as follow:

{
  "message": "API rate limit exceeded for XX.XX.XX.XX. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"
}

The code checks for invalid JSON but not for valid JSON with status code different than 200, as this case. I added a check for the status code too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant