Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

log.info in defaultErrorFormatter #983

Answered by mcollina
PieterJanVdb asked this question in Q&A
Discussion options

I was wondering what the reasoning was for the following change (a115d81#diff-0af7067b49efcaf7dae9a3707f2e79638b336e72780d2b834e007f80ef9a5fa0):

image

Is it because a GraphQL error could represent anything from a server error to a client validation error and log.info is the lowest common denominator log level wise?

You must be logged in to vote

Because an error in GraphQL will return a 200 anyway. It's an expected response and not an error situation for the server.

Replies: 1 comment 2 replies

Comment options

Because an error in GraphQL will return a 200 anyway. It's an expected response and not an error situation for the server.

You must be logged in to vote
2 replies
Comment options

Hmm out of curiosity, would the best thing to do be to trace any server errors that might still result in a 200 (eg some connection not resolving correctly) separately from w/e the defaultErrorFormatter is doing in eg. the onResolution hook and assume that all logging from the defaultErrorFormatter is informational, while the developer is responsible for separately tracing actual exceptions?

Comment options

if there are specicific class of errors you want to treat differentely, you can go ahead and implement your own formatter. I actually recommend to.

Answer selected by PieterJanVdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /