// setErr records the first error encountered.
183235
func (s *Segmenter) setErr(err error) {
	if s.err == nil || s.err == io.EOF {
		s.err = err
	}
}
736324
func (r *Response) SetError(err error) *Response {
	r.Error = err
	return r
}
1096405
func setError(o Option, value string, err error) *Error {
	return &Error{
		ErrorCode: Invalid,
		Name:      o.Name(),
		Parameter: value,
		Err:       err,
	}
}
1339859
func (s *Wrapper) SetReadError(err error) {
	s.Lock()
	defer s.Unlock()
	s.readErr = err
}
1046194
func (s *MultipartUpload) SetOwner(v *Owner) *MultipartUpload {
	s.Owner = v
	return s
}
658245
func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput {
	s.Owner = v
	return s
}
669114
func (p *parser) SetErr(context, value string) {
	if p.err == nil {
		p.err = fmt.Errorf("nmea: %s invalid %s: %s", p.Prefix(), context, value)
	}
}
349332
func (b *Base) SetErrorHandler(eh ErrorHandler) error {
	if eh == nil {
		return errors.New("error handler must be non-nil")
	}

	b.mutex.Lock()
	defer b.mutex.Unlock()
	b.errHandler = eh

	return nil
}
954053
func (s *Status) SetError(err error) {

	if err == nil {
		s.Code = ""
		s.Message = ""
		s.Errors = nil
		return
	}

	cause := errors.Cause(err)

	if astErr, ok := cause.(ast.Errors); ok {
		s.Code = errCode
		s.Message = types.MsgCompileModuleError
		s.Errors = make([]error, len(astErr))
		for i := range astErr {
			s.Errors[i] = astErr[i]
		}
	} else {
		s.Code = errCode
		s.Message = err.Error()
		s.Errors = nil
	}
}
393732
func (s *DeleteMarkerEntry) SetOwner(v *Owner) *DeleteMarkerEntry {
	s.Owner = v
	return s
}
397977
func (s *TaskStartFailedEventDetails) SetError(v string) *TaskStartFailedEventDetails {
	s.Error = &v
	return s
}
507729
func (fs *errorFS) SetError(t reflect.Type, err syscall.Errno) {
	fs.mu.Lock()
	defer fs.mu.Unlock()

	fs.errors[t] = err
}
367201
func errnoErr(e syscall.Errno) error {
	switch e {
	case 0:
		return nil
	case errnoERROR_IO_PENDING:
		return errERROR_IO_PENDING
	}
	// TODO: add more here, after collecting data on the common
	// error values see on Windows. (perhaps when running
	// all.bat?)
	return e
}
585078
func (i *PendingItem) SetErr(err error) {
	if err == nil {
		panic("internal error")
	}
	i.lock.Lock()
	defer i.lock.Unlock()
	if i.err == nil {
		i.err = err
		for _, child := range i.linked {
			child.lock.Lock()
			child.err = err
			child.lock.Unlock()
		}
	}
}
440628
func (s *Subscription) SetOwner(v string) *Subscription {
	s.Owner = &v
	return s
}
1289275
func (s *LambdaFunctionTimedOutEventDetails) SetError(v string) *LambdaFunctionTimedOutEventDetails {
	s.Error = &v
	return s
}
790408
func (ssa *SQLStorageAuthority) SetOrderError(ctx context.Context, order *corepb.Order) error {
	tx, err := ssa.dbMap.Begin()
	if err != nil {
		return err
	}
	txWithCtx := tx.WithContext(ctx)

	om, err := orderToModel(order)
	if err != nil {
		return Rollback(tx, err)
	}

	result, err := txWithCtx.Exec(`
		UPDATE orders
		SET error = ?
		WHERE id = ?`,
		om.Error,
		om.ID)
	if err != nil {
		err = berrors.InternalServerError("error updating order error field")
		return Rollback(tx, err)
	}

	n, err := result.RowsAffected()
	if err != nil || n == 0 {
		err = berrors.InternalServerError("no order updated with new error field")
		return Rollback(tx, err)
	}

	return tx.Commit()
}