// error checking common to all trackers
326502
func (pt pollingTrackerBase) baseCheckForErrors() error {
	// for Azure-AsyncOperations the response body cannot be nil or empty
	if pt.Pm == PollingAsyncOperation {
		if pt.resp.Body == nil || pt.resp.ContentLength == 0 {
			return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "for Azure-AsyncOperation response body cannot be nil")
		}
		if pt.rawBody["status"] == nil {
			return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "missing status property in Azure-AsyncOperation response body")
		}
	}
	return nil
}
551848
func Check(d *certdata.Data) *errors.Errors {
	var e = errors.New(nil)

	gkp := goodkey.NewKeyPolicy()
	err := gkp.GoodKey(d.Cert.PublicKey)
	if err != nil {
		e.Err("Certificate %s", strings.ToLower(err.Error()))
		return e
	}

	return e
}
302665
func CheckError(err error, stderr bytes.Buffer) error {
	if err.Error() == convertErrorStatus &&
		strings.Index(stderr.String(), convertError) > -1 {
		return nil
	}
	return err
}
623096
func (c *baseCatcher) HasErrors() bool {
	c.mutex.RLock()
	defer c.mutex.RUnlock()

	return len(c.errs) > 0
}
654980
func (val *Validation) Check() error {
	if val == nil || len(val.Errors) <= 0 {
		return nil
	}

	return val.constructErrorMessage()
}
239579
func FailFastSequentialChecker(checkers []StatusChecker) (checker StatusChecker) {
	f := func() Status {
		for i := range checkers {
			status := checkers[i].RunCheck()
			if !status.GoodToGo {
				return status
			}
		}
		status := Status{
			GoodToGo: true,
			Message:  "OK",
		}
		return status
	}
	return f
}
509436
func (h *Handler) Check(err error) {
	// Check iff there were no errors
	if h.Err == nil {
		h.Err = err
	}
}
448988
func Check(d *certdata.Data) *errors.Errors {
	var e = errors.New(nil)

	switch d.Type {
	case "DV", "OV", "EV":
		if d.Cert.IsCA {
			e.Err("Certificate has set CA true")
		}
		if d.Cert.MaxPathLen == 0 && d.Cert.MaxPathLenZero {
			//e.Err("Certificate has set CA true")
		}
		if d.Cert.BasicConstraintsValid {
			//e.Err("Certificate has set CA true")
		}
	}

	return e
}
842312
func (result ErrorResults) OneError() error {
	if n := len(result.Results); n != 1 {
		return fmt.Errorf("expected 1 result, got %d", n)
	}
	if err := result.Results[0].Error; err != nil {
		return err
	}
	return nil
}
1049053
func errFieldMismatch(err error) bool {
	_, ok := err.(*datastore.ErrFieldMismatch)
	return ok
}
713911
func CheckError(t T, err error) bool {
	if err != nil {
		logerror(t, serrorf("CheckError: did not expect to receive err: %v", err))
	}
	return err != nil
}
1295215
func check(err error) {
	if err == nil {
		return
	}

	buildMU.Lock()
	defer buildMU.Unlock()
	build.Status = pb.Status_INFRA_FAILURE
	build.SummaryMarkdown = fmt.Sprintf("run_annotations failure: `%s`", err)
	client.WriteBuild(build)
	fmt.Fprintln(os.Stderr, err)
	os.Exit(1)
}
564598
func IsAdbServerErrorMatching(err error, predicate func(string) bool) bool {
	if err, ok := err.(*errors.Err); ok && err.Code == errors.AdbError {
		return predicate(err.Details.(ErrorResponseDetails).ServerMsg)
	}
	return false
}
348013
func (l *loop) Error() (status int, err error) {
	l.mux.Lock()
	defer l.mux.Unlock()
	status = l.status
	err = l.err
	return
}
1144104
func (d *DefaultMetricCollector) Errors() *rolling.Number {
	d.mutex.RLock()
	defer d.mutex.RUnlock()
	return d.errors
}
1100272
func IsNotFound(err error) bool {
	kerr, ok := err.(*KeyError)
	return ok && kerr.Err == errNotFound
}
903660
func Check(d *certdata.Data) *errors.Errors {
	var e = errors.New(nil)
	for _, ext := range d.Cert.Extensions {
		// Check for any imported extensions and run all matching
		e.Append(checks.Extensions.Check(ext, d))
	}
	return e
}