fix(cli): fix error display, considering structured data returned from
generate command
This commit is contained in:
parent
dcfc95e563
commit
ea9c85fb94
1 changed files with 3 additions and 2 deletions
|
|
@ -748,7 +748,8 @@ impl Generate {
|
|||
// Exit early to prevent errors from being printed a second time in the caller
|
||||
std::process::exit(1);
|
||||
} else {
|
||||
return Err(err.into());
|
||||
// Removes extra context associated with the error
|
||||
Err(anyhow!(err.to_string()))?;
|
||||
}
|
||||
}
|
||||
if self.build {
|
||||
|
|
@ -1640,7 +1641,7 @@ fn main() {
|
|||
}
|
||||
}
|
||||
if !err.to_string().is_empty() {
|
||||
eprintln!("{err}");
|
||||
eprintln!("{err:?}");
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue