mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-04 20:32:27 +01:00
Refactor HighlightingAssets::get_syntax to return Result type
This commit is contained in:
11
src/error.rs
11
src/error.rs
@@ -10,6 +10,17 @@ error_chain! {
|
||||
GlobParsingError(::globset::Error);
|
||||
SerdeYamlError(::serde_yaml::Error);
|
||||
}
|
||||
|
||||
errors {
|
||||
UndetectedSyntax(input: String) {
|
||||
description("unable to detect syntax"),
|
||||
display("unable to detect syntax for {}", input)
|
||||
}
|
||||
UnknownSyntax(name: String) {
|
||||
description("unknown syntax"),
|
||||
display("unknown syntax: '{}'", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
|
||||
|
Reference in New Issue
Block a user