feat: Add errorsEncountered to the errors sent back#1740
Conversation
|
I think it's worth adding a test, see similar tests I added to this logging here |
error details
…s/gax-nodejs into add-errors-encountered
The details property is not the right property
data is stringified
|
@sofisl Ok. I added some tests. It's interesting that the test in |
| await client.attemptSequence(attemptRequest, settings); | ||
| assert.fail('The operation should have failed') | ||
| } catch (e) { | ||
| const expectedMessage = 'Total timeout of API google.showcase.v1beta1.SequenceService exceeded 1 milliseconds retrying error Error: 14 UNAVAILABLE: 14 before any response was received.'; |
There was a problem hiding this comment.
Maybe you should try the test with different errors so that you can test your new functionality? Assuming you want something more than just the current error message.
There was a problem hiding this comment.
In this PR it is the unit test checking for the Previous errors string that is more critical. My suspicion is that this test doesn't even test the code path where the source code changes are. I think it targets streaming calls, but it's nice to have anyway.
There was a problem hiding this comment.
I ran an experiment in the other PR and have verified in the test run at https://github.com/googleapis/gax-nodejs/actions/runs/14716048863/job/41299549173?pr=1743 that the previous errors are getting included in the error message.
Description
As the client retries, this change collects errors that are encountered. Then when an error is encountered that is not retried and that error reaches the user, it will contain information about all the errors that were encountered during a series of retries which will help identify what happened during a call with a handwritten client library.
Impact
Bugs like https://github.com/googleapis/nodejs-datastore/issues/1176 are not surfacing all errors encountered which makes them extremely hard to troubleshoot. As a result, we are not able to do root cause analysis because original errors are hard to find. This fix will help us troubleshoot ambiguous errors in our clients and find root causes.
Testing
None at the moment.
Additional Information
This adds information to the error details that the user will receive.
Next Steps
This change is just for normal calls. We can consider making this change for other call types as well.