// ErrorR is a structured error message for a request
164244
func ErrorR(req *http.Request, err error, data Data) {
	ErrorC(GetRequestID(req), err, data)
}
5949
func (r *RawLogger) Err(message []byte) {
	fmt.Fprint(os.Stderr, string(message))

}
706942
func errnoErr(e syscall.Errno) error {
	switch e {
	case 0:
		return nil
	case unix.EAGAIN:
		return syscall.EAGAIN
	case unix.EINVAL:
		return syscall.EINVAL
	case unix.ENOENT:
		return syscall.ENOENT
	}
	return e
}
337586
func (z *StreamLexer) Err() error {
	if z.err == io.EOF && z.pos < len(z.buf) {
		return nil
	}
	return z.err
}
911064
func humanErr(err error) error {
	if err != nil {
		if status, ok := status.FromError(err); ok {
			return errors.New(status.Message())
		}
	}
	return err
}
1115782
func onError(err error) {
	// TODO do not marshal options again here
	switch e := err.(type) {
	case dnode.MethodNotFoundError: // Tell the requester "method is not found".
		args, err2 := e.Args.Slice()
		if err2 != nil {
			return
		}

		if len(args) < 1 {
			return
		}

		var options callOptions
		if err := args[0].Unmarshal(&options); err != nil {
			return
		}

		if options.ResponseCallback.Caller != nil {
			response := Response{
				Result: nil,
				Error: &Error{
					Type:    "methodNotFound",
					Message: err.Error(),
				},
			}
			options.ResponseCallback.Call(response)
		}
	}
}
571820
func ErrorHandler(h utils.ErrorHandler) optSetter {
	return func(b *Buffer) error {
		b.errHandler = h
		return nil
	}
}
29255
func (l *lexer) err(e error) Error {
	// do we have an error?
	if e == nil {
		return nil
	} else {
		return NewError(e, l.Position())
	}
}
804163
func (response *Response) Err() error {
	if len(response.Errors) > 0 {
		return response.Errors[0]
	}
	return nil
}
1059894
func (w *Writer) Err(m string) error {
	_, err := w.writeAndRetry(LOG_ERR, m)
	return err
}
1234805
func (d *Dispenser) Err(msg string) error {
	msg = fmt.Sprintf("%s:%d - Error during parsing: %s", d.File(), d.Line(), msg)
	return errors.New(msg)
}
923506
func (t *Tomb) Err() (reason error) {
	t.init()
	t.m.Lock()
	reason = t.reason
	t.m.Unlock()
	return
}
846098
func (p *Parser) Err() error {
	if p.err != nil {
		return p.err
	}
	return p.r.Err()
}
11210
func ToError(err error) HTTPError {
	switch e := err.(type) {
	case *Error:
		return e
	case HTTPError:
		if et, ok := errors.TypeForStatusCode(e.StatusCode()); ok {
			return NewError(et, e.Error())
		}
	}

	return NewError(errors.InternalServerError, "Internal Server Error")
}
636614
func (rs *Rows) Err() error {
	if rs.lasterr == io.EOF {
		return nil
	}
	return rs.lasterr
}
86246
func (s *Status) Err() error {
	if s.Code() == codes.OK {
		return nil
	}
	return (*statusError)(s.s)
}
58256
func checkErr(err error, handleErr func(string, int)) {
	switch err.(type) {
	case nil:
		return
	case preflightError:
		handleErr(err.Error(), PreFlightExitCode)
	case errorsutil.Aggregate:
		handleErr(err.Error(), ValidationExitCode)

	default:
		handleErr(err.Error(), DefaultErrorExitCode)
	}
}