Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1986c86b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "aflags: make flag storage error message more user-friendly" into main

parents 672af952 e52434aa
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -104,11 +104,16 @@ fn read_device_config_output(command: &[&str]) -> Result<String> {
    if !output.status.success() {
        let reason = match output.status.code() {
            Some(code) => {
                format!("exit code {}, output was {}", code, str::from_utf8(&output.stdout)?)
                let output = str::from_utf8(&output.stdout)?;
                if !output.is_empty() {
                    format!("exit code {code}, output was {output}")
                } else {
                    format!("exit code {code}")
                }
            }
            None => "terminated by signal".to_string(),
        };
        bail!("failed to execute device_config: {}", reason);
        bail!("failed to access flag storage: {}", reason);
    }
    Ok(str::from_utf8(&output.stdout)?.to_string())
}