File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -85,23 +85,23 @@ func IsTransient(err error) bool {
8585 var wEx mongo.WriteException
8686 if errors .As (err , & wEx ) {
8787 for _ , we := range wEx .WriteErrors {
88- _ , ok := transientErrorCodes [we .Code ]
89-
90- return ok
88+ if _ , ok := transientErrorCodes [we .Code ]; ok {
89+ return true
90+ }
9191 }
9292
9393 if wEx .WriteConcernError != nil {
94- _ , ok := transientErrorCodes [wEx .WriteConcernError .Code ]
95-
96- return ok
94+ if _ , ok := transientErrorCodes [wEx .WriteConcernError .Code ]; ok {
95+ return true
96+ }
9797 }
9898 }
9999
100100 var cmdErr mongo.CommandError
101101 if errors .As (err , & cmdErr ) {
102- _ , ok := transientErrorCodes [int (cmdErr .Code )]
103-
104- return ok
102+ if _ , ok := transientErrorCodes [int (cmdErr .Code )]; ok {
103+ return true
104+ }
105105 }
106106
107107 return false
You can’t perform that action at this time.
0 commit comments