-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solvestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Bug report
Describe the bug
Because the Sentry plug-in's middleware comes after that of the GraphQL plug-in, and the GraphQL plug-in catches fatal errors for reporting in the response, fatal errors as part of GraphQL operations are not reported to Sentry.
Other middlewares are likely to suffer from the GraphQL plug-in catching the errors, too.
Steps to reproduce the behavior
- Enable the GraphQL plug-in
- Enable the Sentry plug-in
- Put a
sendError()call somewhere and trigger the call - Notice the error is reported to Sentry
- Put some nonsensical code in a controller or model such as
hi() - Do a GraphQL query that reaches this code
- Notice the error is part of the GraphQL response
- Notice the error is not caught by the Sentry plug-in/middleware, therefore not reported to Sentry
Expected behavior
I expect fatal errors to be both reported by the GraphQL response, as well as reported by the Sentry plug-in to Sentry
Screenshots
These console logs, added to node_modules/strapi-sentry-plugin/middlewares/sentry/index.js, are not logged when calling a GraphQL query that triggers an error:
I also tried to put the Sentry middleware before that of GraphQL, to no avail, probably because we're talking about middlewares as part of plug-ins:
// config/middleware.js
module.exports = () => ({
load: { order: ['sentry', 'graphql'] },
})System
- Node.js version: v14.15.0
- Yarn version: 1.22.5
- Strapi version: 3.6.2
- Database: MySQL
- Operating system: macOS 11.3
abjrcode and jonom
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solvestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
