diff options
author | Ethan P <eth-p+git@hidden.email> | 2020-05-15 17:52:33 -0700 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-05-16 13:44:26 +0200 |
commit | 5aa20c090bb01abf1fd2266bad35413447eff846 (patch) | |
tree | 8f533053daaded85725aa9fb22f8badfd0aebb68 /src/error.rs | |
parent | 9c371ed8a26dc51038c79b79e43f2f6e28461f5a (diff) |
Refactor HighlightingAssets::get_syntax to return Result type
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 057c687a..2e73b85b 100644 --- a/src/error.rs +++ b/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) { |