diff options
author | Kyohei Uto <im@kyoheiu.dev> | 2023-11-01 16:16:42 +0900 |
---|---|---|
committer | Kyohei Uto <im@kyoheiu.dev> | 2023-11-01 16:16:42 +0900 |
commit | cc12f32c9d722cb1d44a36577ca5b6db53375e34 (patch) | |
tree | 8161a11f4e31e86b99a043cfea1ccd3711e1ad66 | |
parent | a7ea41a77672c9e24192a82584efa5e32d8f6284 (diff) |
Add FxError::InvalidPath to deal with to_str() error
-rw-r--r-- | src/errors.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index 112f2bd..fa58e79 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -18,6 +18,7 @@ pub enum FxError { TooSmallWindowSize, Log(String), Unpack(String), + InvalidPath, Panic, #[cfg(any(target_os = "linux", target_os = "netbsd"))] Nix(String), @@ -29,7 +30,7 @@ impl std::fmt::Display for FxError { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { let printable = match self { FxError::Arg(s) => s.to_owned(), - FxError::TerminalSizeDetection => "Error: Cannot detect terminal size.".to_owned(), + FxError::TerminalSizeDetection => "Error: Cannot detect terminal size".to_owned(), FxError::Io(s) => s.to_owned(), FxError::Dirs(s) => s.to_owned(), FxError::GetItem => "Error: Cannot get item info".to_owned(), @@ -46,6 +47,7 @@ impl std::fmt::Display for FxError { FxError::TooSmallWindowSize => "Error: Too small window size".to_owned(), FxError::Log(s) => s.to_owned(), FxError::Unpack(s) => s.to_owned(), + FxError::InvalidPath => "Error: Path may contain invalid unicode".to_owned(), FxError::Panic => "Error: felix panicked".to_owned(), #[cfg(any(target_os = "linux", target_os = "netbsd"))] FxError::Nix(s) => s.to_owned(), |