rotisserie/eris

redundant code in example

jba opened this issue · 2 comments

jba commented

In the doc comment you have the example code

if eris.Is(err, NotFound) || eris.Cause(err) == NotFound 

I think the second half is redundant. The only way Is returns false is if it reaches the end of the chain, which means that the last error in the chain would already have been compared to NotFound.

That was intentional to show that both are options (though they behave differently), so yeah the second one is redundant. I’ll make it more clear since it’s causing some confusion though. Thanks for the feedback!

Updated the example, hopefully it's more clear now!