Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type AerospikeError struct {
// and changed the data. Only applies to commands that change data
InDoubt bool

// Iteration determies on which retry the error occurred
// Iteration determines on which retry the error occurred
Iteration int

// Includes stack frames for the error
Expand Down Expand Up @@ -217,7 +217,7 @@ func (ase *AerospikeError) iter(i int) Error {
// IsInDoubt signifies that the write operation may have gone through on the server
// but the client is not able to confirm that due an error.
func (ase *AerospikeError) IsInDoubt() bool {
return ase.InDoubt
return ase != nil && ase.InDoubt
}

// Matches returns true if the error or any of its wrapped errors contains
Expand Down Expand Up @@ -294,6 +294,10 @@ func (ase *AerospikeError) Is(e error) bool {

// Unwrap will return the error wrapped inside the error, or nil.
func (ase *AerospikeError) Unwrap() error {
if ase == nil {
return nil
}

return ase.wrapped
}

Expand Down