Skip to content

Commit 4390050

Browse files
authored
fix isRetriableError (#159)
fix issues-158
1 parent 8d10ac8 commit 4390050

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

consumer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ func (c *Consumer) getShardIterator(ctx context.Context, streamName, shardID, se
299299
}
300300

301301
func isRetriableError(err error) bool {
302-
switch err.(type) {
303-
case *types.ExpiredIteratorException:
302+
if oe := (*types.ExpiredIteratorException)(nil); errors.As(err, &oe) {
304303
return true
305-
case *types.ProvisionedThroughputExceededException:
304+
}
305+
if oe := (*types.ProvisionedThroughputExceededException)(nil); errors.As(err, &oe) {
306306
return true
307307
}
308308
return false

0 commit comments

Comments
 (0)