chore: refactor: error cause type.
This commit is contained in:
@ -17,7 +17,10 @@
|
||||
|
||||
package internal
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ErrCause returns the cause of the error, the inner-most error in the wrapped chain.
|
||||
func ErrCause(err error) error {
|
||||
@ -29,3 +32,7 @@ func ErrCause(err error) error {
|
||||
|
||||
return cause
|
||||
}
|
||||
|
||||
func ErrCauseType(err error) string {
|
||||
return fmt.Sprintf("%T", ErrCause(err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user