Skip to content

Commit

Permalink
propagate error instead of expect
Browse files Browse the repository at this point in the history
  • Loading branch information
dmackdev committed Nov 21, 2024
1 parent 2964ac9 commit 209cd10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ fn overflow_validation(mode: &PresentMode, config: &ValidateOverflows) -> bool {
fn create_speaker_notes_service_builder(
presentation_path: &Path,
) -> Result<Builder<SpeakerNotesCommand, (), Service>, Box<dyn std::error::Error>> {
let file_name = presentation_path.file_name().expect("failed to resolve presentation file name").to_string_lossy();
let file_name = presentation_path
.file_name()
.ok_or(Cli::command().error(ErrorKind::InvalidValue, "failed to resolve presentation file name"))?
.to_string_lossy();
let service_name = format!("presenterm/{file_name}").as_str().try_into()?;
let service = NodeBuilder::new()
.create::<Service>()?
Expand Down

0 comments on commit 209cd10

Please sign in to comment.