Call VerifySuccess before return to user#151
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the Go client session APIs by internalizing TSStatus verification (VerifySuccess) and updating many write/DDL-style methods to return only error. This reduces the chance of callers forgetting to validate status codes and standardizes error handling across the client.
Changes:
- Refactors many
Sessionmethods to returnerroronly, callingVerifySuccessinternally after RPCs. - Updates table-session interfaces (
ITableSession) and session pool wrappers to match the simplified signatures. - Updates e2e tests and examples to use the new error-only APIs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
client/session.go |
Refactors many methods to return only error and verifies status internally. |
client/tablesession.go |
Updates ITableSession and TableSession methods to return error only. |
client/tablesessionpool.go |
Updates pooled table session wrappers to the new error-only API. |
test/e2e/e2e_test.go |
Adjusts e2e tests to the new error-only APIs. |
test/e2e/e2e_table_test.go |
Adjusts table e2e tests to the new error-only APIs. |
example/session_example.go |
Updates example code to handle error-only returns. |
example/session_pool/session_pool_example.go |
Updates session pool example code to handle error-only returns. |
example/table/table_session_example.go |
Updates table session example code to handle error-only returns. |
example/session_pool/table/table_session_pool_example.go |
Updates table session pool example code to handle error-only returns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jt2594838
approved these changes
Feb 12, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request refactors the
Sessionmethods inclient/session.goto standardize error handling and simplify method signatures. The main change is that several methods which previously returned both a status and an error now return only an error, with status verification handled internally. This makes the API easier to use and less error-prone for clients.API simplification and error handling improvements:
SetStorageGroup,DeleteStorageGroup,DeleteStorageGroups,CreateTimeseries,CreateAlignedTimeseries,CreateMultiTimeseries,DeleteTimeseries,DeleteData,InsertStringRecord,SetTimeZone,ExecuteNonQueryStatement,InsertRecord,InsertAlignedRecord,InsertRecordsOfOneDevice,InsertAlignedRecordsOfOneDevice,InsertRecords, andInsertAlignedRecords) to return only anerrorinstead of both a status and an error. Status checking is now done internally usingVerifySuccess. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]Internal logic and consistency improvements:
VerifySuccessafter RPC calls and to return early if an error is encountered, ensuring consistent error propagation and reducing code duplication. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27]These changes make the session API cleaner and help prevent misuse by encapsulating status verification and error handling within each method.