Skip to content

Commit 0057dbd

Browse files
committed
update tests
1 parent 0debeef commit 0057dbd

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

mongo/errors.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,19 @@ func replaceErrors(err error) error {
5353
return nil
5454
}
5555

56-
fmt.Println("replaceErrors", reflect.TypeOf(err))
56+
fmt.Println("replaceErrors", reflect.TypeOf(err), err)
57+
if de := new(driver.Error); errors.As(err, de) {
58+
fmt.Println("driver.Error", reflect.TypeOf(de.Wrapped), de.Wrapped)
59+
}
60+
if qe := new(driver.QueryFailureError); errors.As(err, qe) {
61+
fmt.Println("driver.QueryFailureError", reflect.TypeOf(qe.Wrapped), qe.Wrapped)
62+
}
63+
if me := new(mongocrypt.Error); errors.As(err, me) {
64+
fmt.Println("mongocrypt.Error")
65+
}
66+
if marshalErr := new(codecutil.MarshalError); errors.As(err, marshalErr) {
67+
fmt.Println("codecutil.MarshalError")
68+
}
5769

5870
// Do not propagate the acknowledgement sentinel error. For DDL commands,
5971
// (creating indexes, dropping collections, etc) acknowledgement should be

0 commit comments

Comments
 (0)