code: func IsDetailedErr(err error) error {
  	if e, ok := err.(*detailedErr); ok {
  		return e.err
  	}
  	return err
  }
docs: // IsDetailedErr returns the error's type if the error
  // is a detailedErr, otherwise return it back