pub enum SearchError {
NoTranslationFiles {
text: String,
searched_paths: String,
},
YamlParseError {
file: PathBuf,
reason: String,
},
JsonParseError {
file: PathBuf,
reason: String,
},
NoCodeReferences {
key: String,
file: PathBuf,
},
Io(Error),
RipgrepExecutionFailed(String),
InvalidUtf8(FromUtf8Error),
InvalidPath(String),
Generic(String),
}Expand description
Custom error type for code search operations
Variants§
NoTranslationFiles
No translation files found containing the search text
YamlParseError
Failed to parse YAML file
JsonParseError
Failed to parse JSON file
NoCodeReferences
Translation key found but no code references detected
Io(Error)
IO error occurred
RipgrepExecutionFailed(String)
Failed to execute ripgrep command
InvalidUtf8(FromUtf8Error)
Invalid UTF-8 in ripgrep output
InvalidPath(String)
Failed to parse file path
Generic(String)
Generic search error with context
Implementations§
Source§impl SearchError
impl SearchError
Sourcepub fn no_translation_files(text: impl Into<String>) -> Self
pub fn no_translation_files(text: impl Into<String>) -> Self
Create a NoTranslationFiles error with default searched paths
Sourcepub fn no_translation_files_with_paths(
text: impl Into<String>,
paths: impl Into<String>,
) -> Self
pub fn no_translation_files_with_paths( text: impl Into<String>, paths: impl Into<String>, ) -> Self
Create a NoTranslationFiles error with custom searched paths
Sourcepub fn yaml_parse_error(
file: impl Into<PathBuf>,
reason: impl Into<String>,
) -> Self
pub fn yaml_parse_error( file: impl Into<PathBuf>, reason: impl Into<String>, ) -> Self
Create a YamlParseError from a file path and error
Trait Implementations§
Source§impl Debug for SearchError
impl Debug for SearchError
Source§impl Display for SearchError
impl Display for SearchError
Source§impl Error for SearchError
impl Error for SearchError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for SearchError
impl From<Error> for SearchError
Source§impl From<FromUtf8Error> for SearchError
impl From<FromUtf8Error> for SearchError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SearchError
impl !RefUnwindSafe for SearchError
impl Send for SearchError
impl Sync for SearchError
impl Unpin for SearchError
impl !UnwindSafe for SearchError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more