Skip to content

Commit d7e63db

Browse files
committed
fix godoc
1 parent 517d5ae commit d7e63db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

error_113.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "errors"
66

77
// IsOfType is a type check for errors.
88
// Returns true either if both are of exactly the same type, or if the same is true for one of current type's ancestors.
9-
// For an error that does not have an errorx type, returns false.
9+
// For an error that does not have an errorx type, returns false unless it wraps another error of errorx type.
1010
func IsOfType(err error, t *Type) bool {
1111
e := burrowForTyped(err)
1212
return e != nil && e.IsOfType(t)
@@ -16,6 +16,7 @@ func IsOfType(err error, t *Type) bool {
1616
// IsOfType is a proper type check for an errorx-based errors.
1717
// It takes the transparency and error types hierarchy into account,
1818
// so that type check against any supertype of the original cause passes.
19+
// It also tolerates non-errorx errors in chain if those errors support go 1.13 errors unwrap.
1920
func (e *Error) IsOfType(t *Type) bool {
2021
cause := e
2122
for cause != nil {

0 commit comments

Comments
 (0)