Skip to content

Call VerifySuccess before return to user#151

Merged
jt2594838 merged 4 commits intomainfrom
move_verify_succuss
Feb 12, 2026
Merged

Call VerifySuccess before return to user#151
jt2594838 merged 4 commits intomainfrom
move_verify_succuss

Conversation

@HTHou
Copy link
Contributor

@HTHou HTHou commented Feb 11, 2026

This pull request refactors the Session methods in client/session.go to 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:

  • Changed multiple methods (such as SetStorageGroup, DeleteStorageGroup, DeleteStorageGroups, CreateTimeseries, CreateAlignedTimeseries, CreateMultiTimeseries, DeleteTimeseries, DeleteData, InsertStringRecord, SetTimeZone, ExecuteNonQueryStatement, InsertRecord, InsertAlignedRecord, InsertRecordsOfOneDevice, InsertAlignedRecordsOfOneDevice, InsertRecords, and InsertAlignedRecords) to return only an error instead of both a status and an error. Status checking is now done internally using VerifySuccess. [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:

These changes make the session API cleaner and help prevent misuse by encapsulating status verification and error handling within each method.

@HTHou HTHou changed the title Call VerifySuccess before return to User Call VerifySuccess before return to user Feb 11, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Session methods to return error only, calling VerifySuccess internally 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 jt2594838 merged commit 6ba97f5 into main Feb 12, 2026
12 checks passed
@jt2594838 jt2594838 deleted the move_verify_succuss branch February 12, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants