Log prettier errors on failures (#19951)
Closes https://github.com/zed-industries/zed/issues/11987 Release Notes: - Fixed prettier not reporting failures in the status panel on formatting and installation errors
This commit is contained in:
parent
0ba40bdfb8
commit
d49cd0019f
7 changed files with 146 additions and 85 deletions
|
@ -104,7 +104,19 @@ impl ErrorExt for anyhow::Error {
|
|||
if let Some(rpc_error) = self.downcast_ref::<RpcError>() {
|
||||
rpc_error.to_proto()
|
||||
} else {
|
||||
ErrorCode::Internal.message(format!("{}", self)).to_proto()
|
||||
ErrorCode::Internal
|
||||
.message(
|
||||
format!("{self:#}")
|
||||
.lines()
|
||||
.fold(String::new(), |mut message, line| {
|
||||
if !message.is_empty() {
|
||||
message.push(' ');
|
||||
}
|
||||
message.push_str(line);
|
||||
message
|
||||
}),
|
||||
)
|
||||
.to_proto()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue