errors
errors copied to clipboard
errors.IsAny does not support multi-error
It appears that errors.IsAny does not support multi-error. https://github.com/cockroachdb/errors/blob/c1cc1919cf999fb018fcd038852e969e3d5631cc/markers/markers.go#L152-L205
errors.Is supports multi-error. https://github.com/cockroachdb/errors/blob/c1cc1919cf999fb018fcd038852e969e3d5631cc/markers/markers.go#L44-L92
Perhaps the following equivalent code can be added to IsAny.
// Recursively try multi-error causes, if applicable.
for _, me := range errbase.UnwrapMulti(c) {
if Is(me, reference) {
return true
}
}