We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91c8094 commit c548e7bCopy full SHA for c548e7b
x/mongo/driver/errors.go
@@ -578,9 +578,13 @@ func ExtractErrorFromServerResponse(doc bsoncore.Document) error {
578
// WriteErrors which represent individual operation failures within the context
579
// of a write command.
580
func errorCodes(err error) []int32 {
581
- if driversErr, ok := err.(Error); ok {
582
- return []int32{driversErr.Code}
+ switch e := err.(type) {
+ case Error:
583
+ return []int32{e.Code}
584
+ case *Error:
585
+ if e != nil {
586
587
+ }
588
}
-
589
return nil
590
0 commit comments