mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 01:03:46 +01:00
issue 2561, send all [bat error]s to stderr in default_error_handler
match default.
This commit is contained in:
parent
c76ed99db2
commit
6ea3ac71d7
@ -3,7 +3,7 @@
|
||||
## Features
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- issue 2561, send all [bat error]s to stderr in default_error_handler match default.
|
||||
- Fix `NO_COLOR` support, see #2767 (@acuteenvy)
|
||||
|
||||
## Other
|
||||
|
10
src/error.rs
10
src/error.rs
@ -67,7 +67,15 @@ pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
|
||||
.ok();
|
||||
}
|
||||
_ => {
|
||||
writeln!(output, "{}: {}", Red.paint("[bat error]"), error).ok();
|
||||
// default - always write [bat error] to stderr
|
||||
let stderr = std::io::stderr();
|
||||
writeln!(
|
||||
&mut stderr.lock(),
|
||||
"{}: {}",
|
||||
Red.paint("[bat error]"),
|
||||
error
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user