mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-05 14:10:34 -04:00
Add some context of which file is missing.
In one case where platform.toml is not where we expect add to the os error 2 which file we were looking for.
This commit is contained in:
parent
7d350bd585
commit
9f8bca26d5
1 changed files with 6 additions and 1 deletions
|
@ -5,6 +5,8 @@
|
|||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#[cfg(not(test))]
|
||||
use anyhow::Context;
|
||||
use anyhow::Result;
|
||||
use nix::errno::Errno;
|
||||
use nix::unistd::{access, AccessFlags};
|
||||
|
@ -173,7 +175,10 @@ impl FormatDeviceConfig {
|
|||
impl PlatformConfig {
|
||||
#[cfg(not(test))]
|
||||
async fn load() -> Result<Option<PlatformConfig>> {
|
||||
let config = read_to_string("/usr/share/steamos-manager/platform.toml").await?;
|
||||
let path = "/usr/share/steamos-manager/platform.toml";
|
||||
let config = read_to_string(path)
|
||||
.await
|
||||
.with_context(|| format!("Failed to read {path}"))?;
|
||||
Ok(Some(toml::from_str(config.as_ref())?))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue