Skip to content

Commit

Permalink
chore(telemery): ensure plugin validation errors are captured (#27933)
Browse files Browse the repository at this point in the history
* Try to capture errors

* Log to stdout so that in debug mode these error won't trigger a reporter error infinite loop

* Clarify terms
  • Loading branch information
jamo committed Nov 10, 2020
1 parent d3471e0 commit f49fe0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/gatsby-cli/src/reporter/reporter.ts
Expand Up @@ -158,6 +158,7 @@ class Reporter {

if (structuredError) {
reporterActions.createLog(structuredError)
trackError(`GENERIC_ERROR`, { error: structuredError })
}

// TODO: remove this once Error component can render this info
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-telemetry/src/event-storage.ts
Expand Up @@ -56,7 +56,7 @@ export class EventStorage {
const eventString = JSON.stringify(event)

if (this.debugEvents || this.verbose) {
console.error(`Captured event:`, JSON.parse(eventString))
console.log(`Captured event:`, JSON.parse(eventString))

if (this.debugEvents) {
// Bail because we don't want to send debug events
Expand Down

0 comments on commit f49fe0b

Please sign in to comment.