Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions lib/zinnia.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,22 @@ const catchChildProcessExit = async ({
const moduleName = capitalize(err.moduleName ?? 'Zinnia')
const exitReason = err.exitReason ?? 'for unknown reason'
const message = `${moduleName} crashed ${exitReason}`
const type = err.moduleName === 'voyager' ? 'info' : 'error'
const isCritical = err.moduleName !== 'voyager'
const type = isCritical ? 'error' : 'info'
onActivity({ type, message })
const moduleErr = new Error(message, { cause: err })
// Store the full error message including stdout & stder in the top-level `details` property
Object.assign(moduleErr, { details: err.message })

// Apply a custom rule to force Sentry to group all issues with the same module & exit code
// See https://docs.sentry.io/platforms/node/usage/sdk-fingerprinting/#basic-example
Sentry.withScope(scope => {
scope.setFingerprint([message])
maybeReportErrorToSentry(moduleErr)
})

if (isCritical) {
const moduleErr = new Error(message, { cause: err })
// Store the full error message including stdout & stder in the top-level `details` property
Object.assign(moduleErr, { details: err.message })

// Apply a custom rule to force Sentry to group all issues with the same module & exit code
// See https://docs.sentry.io/platforms/node/usage/sdk-fingerprinting/#basic-example
Sentry.withScope(scope => {
scope.setFingerprint([message])
maybeReportErrorToSentry(moduleErr)
})
}
throw err
}
} finally {
Expand Down