Skip to content

Commit

Permalink
Properly handle final path errors (mgunyho#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun authored and mgunyho committed Aug 24, 2023
1 parent b5ad578 commit 0f099a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ fn main() -> Result<(), TereError> {
Ok((settings, warnings))
})?;

let final_path = TereAppState::init(settings, &warnings)
match TereAppState::init(settings, &warnings)
.and_then(|state| TereTui::init(state, &mut stderr))
// actually run the app and return the final path
.and_then(|mut ui| ui.main_event_loop())?;

Ok((final_path, warnings))
.and_then(|mut ui| ui.main_event_loop())
{
Ok(final_path) => Ok((final_path, warnings)),
Err(e) => Err(e),
}
}
}
};
Expand Down

0 comments on commit 0f099a6

Please sign in to comment.