fix isRetriableError (#159)

fix issues-158
This commit is contained in:
lrs 2024-09-17 03:27:23 +08:00 committed by GitHub
parent 8d10ac8dac
commit ce18f9e022
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -299,10 +299,10 @@ func (c *Consumer) getShardIterator(ctx context.Context, streamName, shardID, se
} }
func isRetriableError(err error) bool { func isRetriableError(err error) bool {
switch err.(type) { if oe := (*types.ExpiredIteratorException)(nil); errors.As(err, &oe) {
case *types.ExpiredIteratorException:
return true return true
case *types.ProvisionedThroughputExceededException: }
if oe := (*types.ProvisionedThroughputExceededException)(nil); errors.As(err, &oe) {
return true return true
} }
return false return false