1use error_chain::error_chain;
6 Clap(::clap::Error) #[cfg(feature = "application")];
8 SyntectError(::syntect::LoadingError);
9 ParseIntError(::std::num::ParseIntError);
10 GlobParsingError(::globset::Error);
11 SerdeYamlError(::serde_yaml::Error);
15 UndetectedSyntax(input: String) {
16 description("unable to detect syntax"),
17 display("unable to detect syntax for {}", input)
19 UnknownSyntax(name: String) {
20 description("unknown syntax"),
21 display("unknown syntax: '{}'", name)
23 InvalidPagerValueBat {
24 description("invalid value `bat` for pager property"),
25 display("Use of bat as a pager is disallowed in order to avoid infinite recursion problems")
30pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
31 use ansi_term::Colour::Red;
34 Error(ErrorKind::Io(ref io_error), _)
35 if io_error.kind() == ::std::io::ErrorKind::BrokenPipe =>
37 ::std::process::exit(0);
39 Error(ErrorKind::SerdeYamlError(_), _) => {
42 "{}: Error while parsing metadata.yaml file: {}",
43 Red.paint("[bat error]"),
49 writeln!(output, "{}: {}", Red.paint("[bat error]"), error).ok();
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list