Yi-Jiahe / hololive-schedule-cli

A CLI tool for requesting stream schedules implemented in Rust
0 stars 0 forks source link

Main panicked at 'Could not get start time', src\main.rs:123:18 #1

Closed Yi-Jiahe closed 1 year ago

Yi-Jiahe commented 1 year ago
thread 'main' panicked at 'Could not get start time', src\main.rs:123:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Unknown version. Main from 043e674 panic line number does not match.

let start: DateTime<Local> = DateTime::from(match stream.live_info {
      VideoLiveInfo {
          start_scheduled: _,
          start_actual: Some(start_actual),
          ..
      } => start_actual,
      VideoLiveInfo {
          start_scheduled: Some(start_scheduled),
          start_actual: None,
          ..
      } => start_scheduled,
      _ => panic!("Could not get start time"),
  });

Possibly unhandled case. Instead of panic-ing and terminating program, it would be better to display an error for the one stream and continue.

Yi-Jiahe commented 1 year ago

Fixed in 0d29953 by introducing fallback required field, available_at