Repository: calcite-avatica-go
Updated Branches:
  refs/heads/master 7891426fd -> b9d80926c


http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/2968def4/statement.go
----------------------------------------------------------------------
diff --git a/statement.go b/statement.go
index a7e0908..b01333b 100644
--- a/statement.go
+++ b/statement.go
@@ -46,7 +46,11 @@ func (s *stmt) Close() error {
                StatementId:  s.statementID,
        })
 
-       return err
+       if err != nil {
+               return s.conn.avaticaErrorToResponseErrorOrError(err)
+       }
+
+       return nil
 }
 
 // NumInput returns the number of placeholder parameters.
@@ -91,7 +95,7 @@ func (s *stmt) exec(ctx context.Context, args []namedValue) 
(driver.Result, erro
        res, err := s.conn.httpClient.post(ctx, msg)
 
        if err != nil {
-               return nil, err
+               return nil, s.conn.avaticaErrorToResponseErrorOrError(err)
        }
 
        results := res.(*message.ExecuteResponse).Results
@@ -136,7 +140,7 @@ func (s *stmt) query(ctx context.Context, args 
[]namedValue) (driver.Rows, error
        res, err := s.conn.httpClient.post(ctx, msg)
 
        if err != nil {
-               return nil, err
+               return nil, s.conn.avaticaErrorToResponseErrorOrError(err)
        }
 
        resultSet := res.(*message.ExecuteResponse).Results

http://git-wip-us.apache.org/repos/asf/calcite-avatica-go/blob/2968def4/transaction.go
----------------------------------------------------------------------
diff --git a/transaction.go b/transaction.go
index 1d428e4..51b8cc7 100644
--- a/transaction.go
+++ b/transaction.go
@@ -35,7 +35,11 @@ func (t *tx) Commit() error {
                ConnectionId: t.conn.connectionId,
        })
 
-       return err
+       if err != nil {
+               return t.conn.avaticaErrorToResponseErrorOrError(err)
+       }
+
+       return nil
 }
 
 // Rollback rolls back a transaction
@@ -47,7 +51,11 @@ func (t *tx) Rollback() error {
                ConnectionId: t.conn.connectionId,
        })
 
-       return err
+       if err != nil {
+               return t.conn.avaticaErrorToResponseErrorOrError(err)
+       }
+
+       return nil
 }
 
 // enableAutoCommit enables auto-commit on the server
@@ -62,5 +70,9 @@ func (t *tx) enableAutoCommit() error {
                },
        })
 
-       return err
+       if err != nil {
+               return t.conn.avaticaErrorToResponseErrorOrError(err)
+       }
+
+       return nil
 }

Reply via email to