Skip to content

Commit

Permalink
move errors to root of ddbretry package
Browse files Browse the repository at this point in the history
  • Loading branch information
Thumbscrew committed Jun 18, 2024
1 parent ce8dac6 commit 51a017c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions ddbretry/ddbretry.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"time"

"github.com/Thumbscrew/aws-go-tools/ddbretry/errors"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
)
Expand Down Expand Up @@ -50,7 +49,7 @@ func (c *RetryDynamoDBClient) DeleteItem(ctx context.Context, input *dynamodb.De
}
}

return nil, errors.NewInvalidRetryError(retries)
return nil, NewInvalidRetryError(retries)
}

func IsProvisionedThroughputExceededException(err error) bool {
Expand Down
3 changes: 1 addition & 2 deletions ddbretry/ddbretry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"
"time"

ierrors "github.com/Thumbscrew/aws-go-tools/ddbretry/errors"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
"github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -190,7 +189,7 @@ func TestRetryDynamoDBClient_DeleteItem(t *testing.T) {
input: &dynamodb.DeleteItemInput{},
},
wantOutput: nil,
wantErr: ierrors.NewInvalidRetryError(-2),
wantErr: NewInvalidRetryError(-2),
},
}
for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion ddbretry/errors/errors.go → ddbretry/errors.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package errors
package ddbretry

import "fmt"

Expand Down

0 comments on commit 51a017c

Please sign in to comment.