From cce32229e088dadd4c0c99bdc759de361d7e6017 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 31 Jan 2020 18:32:02 +0100 Subject: [PATCH] do not bubble up errors on dc_has_import() error!() will show the error directly to the user, this is not useful in this case, and also the message with the function-name is not for the end-user. instead, the ui shall (and already does) show some explaining text if dc_has_import() returns false; the error!() is disturbing here as this results in two hints shown to the user. --- deltachat-ffi/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 98ff0a577..db00f064f 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -1755,7 +1755,9 @@ pub unsafe extern "C" fn dc_imex_has_backup( .with_inner(|ctx| match imex::has_backup(ctx, to_string_lossy(dir)) { Ok(res) => res.strdup(), Err(err) => { - error!(ctx, "dc_imex_has_backup: {}", err); + // do not bubble up error to the user, + // the ui will expect that the file does not exist or cannot be accessed + warn!(ctx, "dc_imex_has_backup: {}", err); ptr::null_mut() } })