Skip to content

Commit

Permalink
feat(term): show first graphql error in ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Mar 1, 2024
1 parent 54b44e8 commit ca29ea0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/synd_term/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,13 @@ impl Client {

match (response.data, response.errors) {
(_, Some(errs)) if !errs.is_empty() => {
for err in errs {
for err in &errs {
error!("{err:?}");
}
Err(anyhow::anyhow!("failed to request synd api"))
Err(anyhow::anyhow!(
"failed to request synd api: {}",
errs.first().unwrap()
))
}
(Some(data), _) => Ok(data),
_ => Err(anyhow::anyhow!("unexpected response",)),
Expand Down

0 comments on commit ca29ea0

Please sign in to comment.