This repository was archived by the owner on Mar 4, 2026. It is now read-only.
fix: unhandled exception error catch#2091
Merged
surbhigarg92 merged 9 commits intogoogleapis:mainfrom Aug 9, 2024
Merged
Conversation
surbhigarg92
reviewed
Aug 7, 2024
surbhigarg92
approved these changes
Aug 7, 2024
olavloite
reviewed
Aug 7, 2024
surbhigarg92
reviewed
Aug 8, 2024
test/spanner.ts
Outdated
| .filter(val => (val as v1.ExecuteSqlRequest).sql) | ||
| .map(req => req as v1.ExecuteSqlRequest); | ||
|
|
||
| assert.strictEqual(requests.length, 6); |
Contributor
There was a problem hiding this comment.
Why are there 6 requests ? There should be 4 requests.
9db3dd8 to
e1b3784
Compare
e1b3784 to
d104bc8
Compare
57f1fc6 to
8f69542
Compare
olavloite
approved these changes
Aug 9, 2024
| }) | ||
| .on('error', () => { | ||
| if (!this.id && this._useInRunner) { | ||
| .on('error', err => { |
Contributor
There was a problem hiding this comment.
For a different refactor PR: It seems that runStream and createReadStream have a lot of duplicated code. Could we combine more of those?
| const database = newTestDatabase(); | ||
| await database.runTransactionAsync(async tx => { | ||
| try { | ||
| await Promise.all([tx!.run(selectSql), tx!.run(invalidSql)]); |
Contributor
There was a problem hiding this comment.
Do we already have a test for the same with these requests in the other order? That is; with the invalid SQL first?
If not, can we add that as well, and verify that:
- The initial call to ExecuteStreamingSql fails, which also means that there is no transaction ID that is returned.
- The transaction is retried with an explicit BeginTransaction and then the invalid SQL + working SQL statement.
- Catch the error from the invalid SQL statement.
- Commit the transaction (even though one of the statements failed).
- The result should be (I think):
ExecuteSql(transaction{begin: {readwrite=true}})
BeginTransaction(readwrite=true)
ExecuteSql(transaction{id:...})
ExecuteSql(transaction{id:...})
Commit
Contributor
There was a problem hiding this comment.
Will be doing this in a separate PR
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Aug 9, 2024
🤖 I have created a release *beep* *boop* --- ## [7.13.0](https://togithub.com/googleapis/nodejs-spanner/compare/v7.12.0...v7.13.0) (2024-08-09) ### Features * **spanner:** Add support for Cloud Spanner Incremental Backups ([#2085](https://togithub.com/googleapis/nodejs-spanner/issues/2085)) ([33b9645](https://togithub.com/googleapis/nodejs-spanner/commit/33b9645d6096e0d77d30fab6aadf5d92da973a67)) ### Bug Fixes * Unhandled exception error catch ([#2091](https://togithub.com/googleapis/nodejs-spanner/issues/2091)) ([e277752](https://togithub.com/googleapis/nodejs-spanner/commit/e277752fad961908e37e37d88d7b6a61d61a078e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fixes: #1972