Skip to content

Commit 13436cb

Browse files
committed
Change error name from InvalidFileOrDirPath to InvalidPath
1 parent 786d788 commit 13436cb

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/core/crypto.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ pub fn hash_buffer(buffer: impl AsRef<[u8]>) -> String {
5050
///
5151
/// Will return error if unable to access file.
5252
pub fn hash_file(filepath: impl AsRef<Path>) -> Result<String> {
53-
hash_stream(
54-
&mut File::open(&filepath).context(selector::InvalidFileOrDirPath {
55-
path: filepath.as_ref(),
56-
})?,
57-
)
53+
hash_stream(&mut File::open(&filepath).context(selector::InvalidPath {
54+
path: filepath.as_ref(),
55+
})?)
5856
}
5957
/// Evaluate checksum hash of a directory.
6058
///
@@ -65,7 +63,7 @@ pub fn hash_dir(dirpath: impl AsRef<Path>) -> Result<String> {
6563
let summary: BTreeMap<String, String> = dirpath
6664
.as_ref()
6765
.read_dir()
68-
.context(selector::InvalidFileOrDirPath {
66+
.context(selector::InvalidPath {
6967
path: dirpath.as_ref(),
7068
})?
7169
.map(|path| {

src/core/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl fmt::Debug for OrcaError {
122122
match &self.kind {
123123
Kind::AgentCommunicationFailure { backtrace, .. }
124124
| Kind::IncompletePacket { backtrace, .. }
125-
| Kind::InvalidFileOrDirPath { backtrace, .. }
125+
| Kind::InvalidPath { backtrace, .. }
126126
| Kind::MissingInfo { backtrace, .. }
127127
| Kind::BollardError { backtrace, .. }
128128
| Kind::ChronoParseError { backtrace, .. }

src/core/store/filestore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl LocalFileStore {
194194
Ok((
195195
serde_yaml::from_str(
196196
&fs::read_to_string(path.clone())
197-
.context(selector::InvalidFileOrDirPath { path })?,
197+
.context(selector::InvalidPath { path })?,
198198
)?,
199199
None,
200200
hash.to_owned(),

src/uniffi/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub(crate) enum Kind {
3737
backtrace: Option<Backtrace>,
3838
},
3939
#[snafu(display("{source} ({path:?})."))]
40-
InvalidFileOrDirPath {
40+
InvalidPath {
4141
path: PathBuf,
4242
source: io::Error,
4343
backtrace: Option<Backtrace>,

src/uniffi/orchestrator/docker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Orchestrator for LocalDockerOrchestrator {
9494
let location = namespace_lookup[&image_info.namespace].join(&image_info.path);
9595
let byte_stream = FramedRead::new(
9696
File::open(&location)
97-
.context(selector::InvalidFileOrDirPath { path: &location })
97+
.context(selector::InvalidPath { path: &location })
9898
.await?,
9999
BytesCodec::new(),
100100
)

0 commit comments

Comments
 (0)