diff options
| author | David Lönnhager <david.l@mullvad.net> | 2022-12-13 11:04:10 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2022-12-14 14:41:04 +0100 |
| commit | 18cc53ff313b837f747b61bed45ab982c7c42c7a (patch) | |
| tree | 8f348de15727e9b51f9b2e83c63ea6b987c44d5b | |
| parent | 9fa1645c4de5bb1242b92636135697ef9dce0b9c (diff) | |
| download | mullvadvpn-18cc53ff313b837f747b61bed45ab982c7c42c7a.tar.xz mullvadvpn-18cc53ff313b837f747b61bed45ab982c7c42c7a.zip | |
Return non-zero status if sending problem report fails
| -rw-r--r-- | mullvad-problem-report/src/main.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/mullvad-problem-report/src/main.rs b/mullvad-problem-report/src/main.rs index 85f0143bee..af38f614d2 100644 --- a/mullvad-problem-report/src/main.rs +++ b/mullvad-problem-report/src/main.rs @@ -127,14 +127,10 @@ fn send_problem_report( report_path: &Path, ) -> Result<(), Error> { let cache_dir = mullvad_paths::get_cache_dir().map_err(Error::ObtainCacheDirectory)?; - match mullvad_problem_report::send_problem_report( - user_email, - user_message, - report_path, - &cache_dir, - ) { - Ok(()) => println!("Problem report sent"), - Err(e) => eprintln!("{}", e.display_chain()), - } - Ok(()) + mullvad_problem_report::send_problem_report(user_email, user_message, report_path, &cache_dir) + .map(|()| println!("Problem report sent")) + .map_err(|error| { + eprintln!("{}", error.display_chain()); + error + }) } |
