Skip to content

Commit

Permalink
GOCBC-213: Replaced ErrInternalError use with ErrCliInternalError.
Browse files Browse the repository at this point in the history
Motivation
----------
In various places throughout the Go SDK, the kv-oriented ErrInternalError
has been used to signal internal errors.  This causes confusion when
debugging as it is not possible to immediately understand where the source
of any particular internal error comes from.

Changes
-------
Imported new ErrCliInternalError error from gocbcore and updated all uses
of ErrInternalError to utilize the new client-oriented error.

Change-Id: I534891bbdd35b41a0d7b843b7e6b35270ff548d1
Reviewed-on: http://review.couchbase.org/80665
Reviewed-by: Michael Nitschinger <michael@nitschinger.at>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information
brett19 committed Jul 18, 2017
1 parent 30c6fc7 commit d87dcf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cluster_n1qlquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func (c *Cluster) doN1qlQuery(b *Bucket, q *N1qlQuery, params interface{}) (Quer

stmtStr, isStr := q.options["statement"].(string)
if !isStr {
return nil, ErrInternalError
return nil, ErrCliInternalError
}

c.clusterLock.RLock()
Expand Down
2 changes: 2 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ var (
ErrNetwork = gocbcore.ErrNetwork
// ErrTimeout occurs when an operation times out.
ErrTimeout = gocbcore.ErrTimeout
// ErrCliInternalError indicates an internal error occurred within the client.
ErrCliInternalError = gocbcore.ErrCliInternalError

// ErrStreamClosed occurs when an error is related to a stream closing.
ErrStreamClosed = gocbcore.ErrStreamClosed
Expand Down

0 comments on commit d87dcf5

Please sign in to comment.