#19 fixes retry on kinesis error

This commit is contained in:
Alex Senger 2024-04-19 13:32:53 +02:00
parent 2d05606a38
commit ca7a109d1b
No known key found for this signature in database
GPG key ID: 0B4A96F8AF6934CF

View file

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