Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error logging #929

Closed
1 of 2 tasks
blittle opened this issue May 23, 2023 · 2 comments
Closed
1 of 2 tasks

Improve error logging #929

blittle opened this issue May 23, 2023 · 2 comments
Assignees

Comments

@blittle
Copy link
Contributor

blittle commented May 23, 2023

Tasks

Preview Give feedback
@frandiox
Copy link
Contributor

We are now adding [h2:<type>:<scope>] prefix to Hydrogen messages, where "type" is info | warn | error and "scope" is the closes public function that shows the message (e.g. storefront.query). We then replace messages with this pattern in H2 CLI with banners in development.
For Storefront API / GraphQL error messages, we create the error with a "cause" like new Error('...', {cause: {graphql: {query: '...', variables: '...'}}). This is also shown in the banners to create a link to the local GraphiQL to debug the query.

cc @snehashah-shopify Not sure if it's something we want to tackle now but this might be useful for improving logs in Oxygen as well.

@frandiox
Copy link
Contributor

@blittle I'm wondering if we should show every error (even those without the h2 pattern) in an error banner. This way the stack trace can be enhanced like in the previous image (it shows the line of the code and trims the paths so they are clickable).

@blittle blittle closed this as completed Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants