Skip to content

Commit c536ac3

Browse files
committed
feat: add error tracing
1 parent afa01a5 commit c536ac3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ Incoming.
4848
* [Async Graphql Crates](https://github.com/async-graphql/async-graphql)
4949
* [Apollo Tracing](https://github.com/apollographql/apollo-tracing)
5050
* [Apollo Server](https://github.com/apollographql/apollo-server)
51-

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,11 @@ impl Extension for ApolloTracingExtension {
443443
})
444444
.collect(),
445445
));
446+
let json = match serde_json::to_string(&e) {
447+
Ok(content) => content,
448+
Err(e) => serde_json::json!({ "error": format!("{:?}", e) }).to_string(),
449+
};
450+
&error.set_json(json);
446451
node.write()
447452
.await
448453
.set_error(RepeatedField::from_vec(vec![error]));

0 commit comments

Comments
 (0)