issue 2561, send all [bat error]s to stderr in default_error_handler

match default.
This commit is contained in:
deboard 2024-01-02 17:44:27 -05:00
parent c76ed99db2
commit 6ea3ac71d7
2 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,7 @@
## Features ## Features
## Bugfixes ## Bugfixes
- issue 2561, send all [bat error]s to stderr in default_error_handler match default.
- Fix `NO_COLOR` support, see #2767 (@acuteenvy) - Fix `NO_COLOR` support, see #2767 (@acuteenvy)
## Other ## Other

View File

@ -67,7 +67,15 @@ pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
.ok(); .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();
} }
}; };
} }