From 43900507c91130e16c436065b0bd5ac86cc2b677 Mon Sep 17 00:00:00 2001 From: lrs <82623629@qq.com> Date: Tue, 17 Sep 2024 03:27:23 +0800 Subject: [PATCH] fix isRetriableError (#159) fix issues-158 --- consumer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/consumer.go b/consumer.go index 47773565..e28fe674 100644 --- a/consumer.go +++ b/consumer.go @@ -299,10 +299,10 @@ func (c *Consumer) getShardIterator(ctx context.Context, streamName, shardID, se } func isRetriableError(err error) bool { - switch err.(type) { - case *types.ExpiredIteratorException: + if oe := (*types.ExpiredIteratorException)(nil); errors.As(err, &oe) { return true - case *types.ProvisionedThroughputExceededException: + } + if oe := (*types.ProvisionedThroughputExceededException)(nil); errors.As(err, &oe) { return true } return false