Refactor HighlightingAssets::get_syntax to return Result type

This commit is contained in:
Ethan P authored and David Peter committed 2020-05-16 13:44:26 +02:00
1 parent 9c371ed8a2
commit 5aa20c090b
3 files changed
+54 -28

No files matched your search

+11
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) {