GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — error-reporting: Fix `report()` silently failing by DominicKramer · Pull Request #2363 · googleapis/google-cloud-node

Conversation

@DominicKramer

@DominicKramer DominicKramer commented Jun 6, 2017

Copy link
Copy Markdown
Contributor

If the report() method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 6, 2017
@stephenplusplus stephenplusplus added the api: error-reporting label Jun 6, 2017
stephenplusplus
stephenplusplus reviewed Jun 6, 2017
View reviewed changes
Comment thread packages/error-reporting/package.json
"repository": "GoogleCloudPlatform/google-cloud-node",
"scripts": {
"test": "nyc --exclude=\"fuzzer.js\" mocha ./test/unit/**/*.js",
"test": "nyc --exclude=\"fuzzer.js\" mocha ./test/unit/*.js ./test/unit/**/*.js",

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Jun 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.988% when pulling 0b34534 on DominicKramer:bug/reporting-non-errors-silently-fails into 03c276d on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Jun 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.988% when pulling 93a897c on DominicKramer:bug/reporting-non-errors-silently-fails into 03c276d on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Jun 7, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.988% when pulling 10807f1 on DominicKramer:bug/reporting-non-errors-silently-fails into 03c276d on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DominicKramer
DominicKramer requested a review from ofrobots June 7, 2017 17:04
@coveralls

coveralls commented Jun 7, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.988% when pulling 2e6b422 on DominicKramer:bug/reporting-non-errors-silently-fails into 03c276d on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ofrobots
ofrobots reviewed Jun 9, 2017
View reviewed changes

@ofrobots ofrobots left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Some of them were present in the original code, so it might be acceptable to do them in a follow-on (ie. keep this as a refactor, and make logical changes in a follow-on).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/error-reporting/src/build-stack-trace.js Outdated
* Constructs a string representation of the stack trace at the point where
* this function was invoked. Note that the stack trace will not include any
* references to this function itself.
* @function buildStackTrace

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/error-reporting/src/interfaces/message-builder.js Outdated
var fauxError = new Error('');
var fullStack = fauxError.stack.split('\n');
var cleanedStack = fullStack.slice(2).join('\n');
var cleanedStack = buildStackTrace('', 1);

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/error-reporting/src/populate-error-message.js Outdated
function populateErrorMessage(ob, em) {
if (ob === null || ob === undefined) {
populateFromUnknown(ob, em);
} else if (ob instanceof Error) {

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/error-reporting/src/populate-error-message.js Outdated
* @returns {Undefined} - does not return anything
*/
function populateFromNumber(num, errorMessage) {
var message = isNumber(num) && isFunction(num.toString) ? num.toString() : '';

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/error-reporting/src/populate-error-message.js Outdated
* @returns {Undefined} - does not return anything
*/
function populateFromString(str, errorMessage) {
errorMessage.setMessage(buildStackTrace(str, 3));

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DominicKramer added 10 commits June 15, 2017 11:21
@DominicKramer
error-reporting: Fix report() silently failing
2ee9c61
If the `report()` method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.
@DominicKramer
Fix linting errors
61ff46c
@DominicKramer
Add the new build-stack-trace.js file
3942bb7
@DominicKramer
Add more system tests for errors.report()
d40402c
@DominicKramer
Rename errorHandlerRouter to populateErrorMessage
f1f58fd
@DominicKramer
Rename error-router to populate-error-message
8034df5
@DominicKramer
Reorganize the populate-error-message tests
cf81ad3
@DominicKramer
Update buildStackTrace to use captureStackTrace
b747c3b
The `Error.captureStackTrace` method is now used in the
`buildStackTrace` function to create a stack trace.
@DominicKramer
Simplify the system tests
26d98ab
The code for verifiying that stack traces don't contain
error-reporting specific frames has been consolidated into a
single location.
@DominicKramer
Consolidate code in populate-error-message.js
3df370b
@DominicKramer
DominicKramer force-pushed the bug/reporting-non-errors-silently-fails branch from 28226ff to 3df370b Compare June 15, 2017 18:36
@coveralls

coveralls commented Jun 15, 2017

Copy link
Copy Markdown

Coverage remained the same at 99.988% when pulling 3df370b on DominicKramer:bug/reporting-non-errors-silently-fails into 06e743e on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ofrobots
ofrobots approved these changes Jun 15, 2017
View reviewed changes
@DominicKramer
Make the buildStackTrace more robust
24fbc3b
In particular, the `buildStackTrace` was updated to ensure that
no error-reporting specific frames are included in the built
stack trace.  In addition, the system-tests have been updated to
ensure error-reporting related frames, and only those frames, are
removed from the built stack trace.
@coveralls

coveralls commented Jun 15, 2017

Copy link
Copy Markdown

Coverage remained the same at 99.988% when pulling 24fbc3b on DominicKramer:bug/reporting-non-errors-silently-fails into 06e743e on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ofrobots
ofrobots approved these changes Jun 15, 2017
View reviewed changes
@DominicKramer

DominicKramer commented Jun 15, 2017

Copy link
Copy Markdown
Contributor Author

@stephenplusplus This is ready to land.

stephenplusplus reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus
stephenplusplus merged commit 02afcef into googleapis:master Jun 15, 2017
This was referenced Jul 5, 2017
Update dependency @google-cloud/datastore to version 1.0.7 Platane/velib-paris#24
Merged
Update dependency @google-cloud/storage to version 1.2.0 Platane/velib-paris#25
Merged
GautamSharda pushed a commit that referenced this pull request Jan 14, 2026
@DominicKramer @stephenplusplus
error-reporting: Fix report() silently failing (#2363)
a80037d
* error-reporting: Fix `report()` silently failing

If the `report()` method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.

* Fix linting errors

* Add the new `build-stack-trace.js` file

* Add more system tests for `errors.report()`

* Rename errorHandlerRouter to populateErrorMessage

* Rename error-router to populate-error-message

* Reorganize the populate-error-message tests

* Update buildStackTrace to use captureStackTrace

The `Error.captureStackTrace` method is now used in the
`buildStackTrace` function to create a stack trace.

* Simplify the system tests

The code for verifiying that stack traces don't contain
error-reporting specific frames has been consolidated into a
single location.

* Consolidate code in populate-error-message.js

* Make the `buildStackTrace` more robust

In particular, the `buildStackTrace` was updated to ensure that
no error-reporting specific frames are included in the built
stack trace.  In addition, the system-tests have been updated to
ensure error-reporting related frames, and only those frames, are
removed from the built stack trace.
GautamSharda pushed a commit that referenced this pull request Jan 15, 2026
@DominicKramer @stephenplusplus
error-reporting: Fix report() silently failing (#2363)
215f39a
* error-reporting: Fix `report()` silently failing

If the `report()` method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.

* Fix linting errors

* Add the new `build-stack-trace.js` file

* Add more system tests for `errors.report()`

* Rename errorHandlerRouter to populateErrorMessage

* Rename error-router to populate-error-message

* Reorganize the populate-error-message tests

* Update buildStackTrace to use captureStackTrace

The `Error.captureStackTrace` method is now used in the
`buildStackTrace` function to create a stack trace.

* Simplify the system tests

The code for verifiying that stack traces don't contain
error-reporting specific frames has been consolidated into a
single location.

* Consolidate code in populate-error-message.js

* Make the `buildStackTrace` more robust

In particular, the `buildStackTrace` was updated to ensure that
no error-reporting specific frames are included in the built
stack trace.  In addition, the system-tests have been updated to
ensure error-reporting related frames, and only those frames, are
removed from the built stack trace.
@GautamSharda GautamSharda mentioned this pull request Jan 20, 2026
chore: migrate code from googleapis/nodejs-error-reporting #7019
Closed
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 5, 2026
@DominicKramer @stephenplusplus
error-reporting: Fix report() silently failing (#2363)
049275e
* error-reporting: Fix `report()` silently failing

If the `report()` method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.

* Fix linting errors

* Add the new `build-stack-trace.js` file

* Add more system tests for `errors.report()`

* Rename errorHandlerRouter to populateErrorMessage

* Rename error-router to populate-error-message

* Reorganize the populate-error-message tests

* Update buildStackTrace to use captureStackTrace

The `Error.captureStackTrace` method is now used in the
`buildStackTrace` function to create a stack trace.

* Simplify the system tests

The code for verifiying that stack traces don't contain
error-reporting specific frames has been consolidated into a
single location.

* Consolidate code in populate-error-message.js

* Make the `buildStackTrace` more robust

In particular, the `buildStackTrace` was updated to ensure that
no error-reporting specific frames are included in the built
stack trace.  In addition, the system-tests have been updated to
ensure error-reporting related frames, and only those frames, are
removed from the built stack trace.
@GautamSharda GautamSharda mentioned this pull request Feb 5, 2026
migrate code from googleapis/nodejs-error-reporting #7169
Closed
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 23, 2026
@DominicKramer @stephenplusplus
error-reporting: Fix report() silently failing (#2363)
0275422
* error-reporting: Fix `report()` silently failing

If the `report()` method is called with a number, an associated
error never appears in the error reporting console, and no log
message is printed to the user to indicate why the error has not
appeared.

* Fix linting errors

* Add the new `build-stack-trace.js` file

* Add more system tests for `errors.report()`

* Rename errorHandlerRouter to populateErrorMessage

* Rename error-router to populate-error-message

* Reorganize the populate-error-message tests

* Update buildStackTrace to use captureStackTrace

The `Error.captureStackTrace` method is now used in the
`buildStackTrace` function to create a stack trace.

* Simplify the system tests

The code for verifiying that stack traces don't contain
error-reporting specific frames has been consolidated into a
single location.

* Consolidate code in populate-error-message.js

* Make the `buildStackTrace` more robust

In particular, the `buildStackTrace` was updated to ensure that
no error-reporting specific frames are included in the built
stack trace.  In addition, the system-tests have been updated to
ensure error-reporting related frames, and only those frames, are
removed from the built stack trace.
This was referenced Feb 23, 2026
migrate code from googleapis/nodejs-error-reporting #7294
Closed
migrate code from googleapis/nodejs-error-reporting #7308
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@stephenplusplus stephenplusplus stephenplusplus left review comments
@ofrobots ofrobots ofrobots approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: error-reporting cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@DominicKramer @coveralls @ofrobots @stephenplusplus @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.