Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Error reporting fails to report some error formats #252

@andresvrl

Description

@andresvrl

errors.report fails when reporting some objects or strings.

  const {ErrorReporting} = require('@google-cloud/error-reporting');

  const errors = new ErrorReporting();

  errors.report({error: "something broke"});
  // errors.report('{error: "something broke"}') also fails

This returns an error:

ERROR:@google-cloud/error-reporting: Encountered an error while attempting to transmit an error to the Stackdriver Error Reporting API. Error: ReportedErrorEvent.context must contain a location unless 'message' contain an exception or stacktrace.

The source states that "err can be anything" so I think this should work:
https://github.com/googleapis/nodejs-error-reporting/blob/master/src/index.ts#L98

I also don't see anything that indicates that the reported error needs to be of a certain format.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: clouderrorreportingIssues related to the googleapis/nodejs-error-reporting API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions