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
21 changes: 12 additions & 9 deletions lib/zinnia.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ const maybeReportErrorToSentry = (/** @type {unknown} */ err) => {
console.error('Reporting the poblem to Sentry for inspection by the Station team.')

/** @type {Parameters<Sentry.captureException>[1]} */
const hint = {}
if (typeof err === 'object' && 'details' in err && typeof err.details === 'string') {
// Quoting from https://develop.sentry.dev/sdk/data-handling/
// > Messages are limited to 8192 characters.
// > Individual extra data items are limited to 16kB. Total extra data is limited to 256kb.
// Let's store the additional details (e.g. stdout && stderr) in an extra field
const tail = err.details.split(/\n/g).slice(-50).join('\n')
hint.extra = {
details: tail
const hint = { extra: {} }
if (typeof err === 'object') {
if ('details' in err && typeof err.details === 'string') {
// Quoting from https://develop.sentry.dev/sdk/data-handling/
// > Messages are limited to 8192 characters.
// > Individual extra data items are limited to 16kB. Total extra data is limited to 256kb.
// Let's store the additional details (e.g. stdout && stderr) in an extra field
const tail = err.details.split(/\n/g).slice(-50).join('\n')
hint.extra.details = tail
}
if ('moduleName' in err && typeof err.moduleName === 'string') {
hint.extra.moduleName = err.moduleName
}
}

Expand Down