Closed knz closed 2 years ago
Thanks! It would take me a long time to really scrutinize the changes to the control flow and I have not attempted to do that. However, I see how you're solving the problem and how the test cases demonstrate that.
Thanks!
Fixes #88.
We've found a need somewhere to implement an
Error()
method on a leaf by delegating the behavior to theFormatter
orSafeFormatter
interfaces. In that case, theerrors.IsAny
call inside the special handler causes a call cycle.This commit breaks the cycle by handling the special cases after the interfaces.
A possible regression would be that one of the stdlib errors starts implementing
fmt.Formatter
, whereby we'd lose the special handling (which, as of this writing, extracts safe strings). At the time of this writing, none of the stdlib errors of interest implementfmt.Formatter
, so we're punting dealing with that when/if it arises in the future.This change is![Reviewable](https://reviewable.io/review_button.svg)