What is better to use Equal or EqualError

61 views Asked by At

I don't see any difference to use in testing EqualError vs Equal. my question is What does EqualError extra?

1

There are 1 answers

1
Fifi On

As stated in the documentation, EqualError takes error as its 2nd and third arguments, while Equal takes any.

When checking the value of an error, you should use EqualError. If not, use Equal.