diff --git a/src/canisters/frontend/ic-asset/src/asset/config.rs b/src/canisters/frontend/ic-asset/src/asset/config.rs index 64da185366..328eb77586 100644 --- a/src/canisters/frontend/ic-asset/src/asset/config.rs +++ b/src/canisters/frontend/ic-asset/src/asset/config.rs @@ -461,6 +461,7 @@ mod with_tempdir { #[cfg(target_family = "unix")] use std::os::unix::prelude::PermissionsExt; use std::{collections::BTreeMap, fs::File}; + use std::error::Error; use tempfile::{Builder, TempDir}; fn create_temporary_assets_directory( @@ -887,9 +888,9 @@ mod with_tempdir { let assets_config = AssetSourceDirectoryConfiguration::load(&assets_dir); assert_eq!( - assets_config.err().unwrap().to_string(), + assets_config.as_ref().err().unwrap().to_string(), format!( - "Failed to read {} as string: Permission denied (os error 13)", + "Failed to read {} as string", assets_dir .join(ASSETS_CONFIG_FILENAME_JSON) .as_path() @@ -897,6 +898,10 @@ mod with_tempdir { .unwrap() ) ); + assert_eq!( + assets_config.err().unwrap().source().unwrap().to_string(), + "Permission denied (os error 13)" + ); } #[test] diff --git a/src/dfx-core/src/error/config.rs b/src/dfx-core/src/error/config.rs index 54e19f464d..17eef4e364 100644 --- a/src/dfx-core/src/error/config.rs +++ b/src/dfx-core/src/error/config.rs @@ -68,9 +68,7 @@ pub enum ApplyExtensionCanisterTypesError { #[derive(Error, Debug)] pub enum ApplyExtensionCanisterTypeError { - #[error( - "failed to apply defaults from extension '{extension}' to canister '{canister}'" - )] + #[error("failed to apply defaults from extension '{extension}' to canister '{canister}'")] ApplyDefaults { canister: Box, extension: Box,