-
Notifications
You must be signed in to change notification settings - Fork 699
Question: Obtaining the original cause #138
Comments
https://github.com/pkg/errors#retrieving-the-cause-of-an-error |
@pierrre I asked because I had a case where errors.Cause was returning an error which when compared to the original named error in a package did not evaluate as equal. We've subsequently worked around the issue by comparing the err.Error() string for each instead, but the problem was perplexing. |
Why aren't they equal ? |
I wish I knew. From everything that I understand, they should be, but for some unknown reason weren't evaluating as equal.
No, I didn't, but in hindsight I should have. For logistical reasons it may not be feasible for me to roll back the project to test this out, but I'll do my best to compare them this week. |
@johngb Any followup on this ? |
I have been using this package for a while now without any problems (I love it). However, today I came across a behaviour in my code that I can't understand when trying compare the result of errors.Cause with a named error. I've read through the documentation, and I came across the following statement:
The text was updated successfully, but these errors were encountered: