Merge pull request #20 from alexgridx/19-fix-retry-on-kinesis-error

#19 fixes retry on kinesis error
This commit is contained in:
Alex 2024-04-19 13:33:41 +02:00 committed by GitHub
commit c372167032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -276,10 +276,12 @@ func (c *Consumer) getShardIterator(ctx context.Context, streamName, shardID, se
} }
func isRetriableError(err error) bool { func isRetriableError(err error) bool {
switch err.(type) { var expiredIteratorException *types.ExpiredIteratorException
case *types.ExpiredIteratorException: var provisionedThroughputExceededException *types.ProvisionedThroughputExceededException
switch {
case errors.As(err, &expiredIteratorException):
return true return true
case *types.ProvisionedThroughputExceededException: case errors.As(err, &provisionedThroughputExceededException):
return true return true
} }
return false return false