1
0
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:
Ethan P
2020-05-15 17:52:33 -07:00
committed by David Peter
parent 9c371ed8a2
commit 5aa20c090b
3 changed files with 54 additions and 28 deletions

View File

@@ -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) {