Skip to content

Commit b26109b

Browse files
hikhvarucirello
authored andcommitted
dynamolock: not wrap LockNotGrantedError in error.errorString
This eases the error handling in the callers code. The old implementation had in information loss. It was not easy to check if the error was simple cased by someone else grapping the lock.
1 parent f08d623 commit b26109b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ func (c *Client) putLockItemAndStartSessionMonitor(
538538

539539
_, err := c.dynamoDB.PutItem(putItemRequest)
540540
if err != nil {
541-
err := parseDynamoDBError(err, "lock already acquired by other client")
542-
return nil, fmt.Errorf("cannot store lock item: %s", err)
541+
return nil, parseDynamoDBError(err, "cannot store lock item: lock already acquired by other client")
543542
}
544543

545544
lockItem := &Lock{

0 commit comments

Comments
 (0)