Skip to content

Conversation

StarpTech
Copy link
Collaborator

@StarpTech StarpTech commented Apr 24, 2025

This PR cleaned up error handling. Before, we joined errors twice, which resulted in duplicated error messages for subgraph access logs. I renamed subgraphErrors to error because it never only represented subgraph logs. I also wrapped the http client error with stack information for more verbose logs.

@StarpTech StarpTech changed the title feat: improve access logs feat: improve error handling Apr 24, 2025
@@ -703,7 +703,7 @@ func (r *Resolvable) addRejectFieldError(reason string, ds DataSourceInfo, field
} else {
errorMessage = fmt.Sprintf("Unauthorized to load field '%s', Reason: %s.", fieldPath, reason)
}
r.ctx.appendSubgraphError(goerrors.Join(errors.New(errorMessage),
r.ctx.appendError(goerrors.Join(errors.New(errorMessage),
Copy link
Member

@endigma endigma Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appendError calls errors.Join inside, which takes a variadic second parameter, perhaps we could just pass this through to avoid nesting errors.Join calls and this odd goerrors alias?

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

Successfully merging this pull request may close these issues.

2 participants