//OnFailure registers a callback function that will be called when Promise is rejected.
//If promise is already rejected, the callback will immediately called.
//The error of Promise will be paramter of Fail callback function.
329078
func (this *Future) OnFailure(callback func(v interface{})) *Future {
	this.addCallback(callback, CALLBACK_FAIL)
	return this
}
1243976
func (s *RobotDeployment) SetFailureReason(v string) *RobotDeployment {
	s.FailureReason = &v
	return s
}
366785
func (c *Controller) OnFinalShutdown(fn func() error) {
	c.instance.onFinalShutdown = append(c.instance.onFinalShutdown, fn)
}
1029105
func (c *Callbacks) OnCUserMessageRumble(fn func(*dota.CUserMessageRumble) error) {
	c.onCUserMessageRumble = append(c.onCUserMessageRumble, fn)
}
1033120
func (f *validationFailer) Fail(test Test, obtained, expected interface{}, msgs ...string) bool {
	f.mux.Lock()
	defer f.mux.Unlock()
	pc, file, line, _ := runtime.Caller(f.offset)
	_, fileName := path.Split(file)
	funcNameParts := strings.Split(runtime.FuncForPC(pc).Name(), ".")
	funcNamePartsIdx := len(funcNameParts) - 1
	funcName := funcNameParts[funcNamePartsIdx]
	obex := obexString(test, obtained, expected)
	err := errors.New(failString(test, obex, msgs...))
	detail := &failureDetail{
		timestamp:  time.Now(),
		fileName:   fileName,
		lineNumber: line,
		funcName:   funcName,
		test:       test,
		err:        err,
		message:    strings.Join(msgs, " "),
	}
	f.details = append(f.details, detail)
	f.errs = append(f.errs, err)
	return false
}
398459
func (s *ModelPackageStatusItem) SetFailureReason(v string) *ModelPackageStatusItem {
	s.FailureReason = &v
	return s
}
992473
func (s *CreateStackInput) SetOnFailure(v string) *CreateStackInput {
	s.OnFailure = &v
	return s
}
747888
func (this *Promise) OnCancel(callback func()) *Promise {
	this.Future.OnCancel(callback)
	return this
}
132585
func (s *FailedItemDetails) SetFailureCode(v string) *FailedItemDetails {
	s.FailureCode = &v
	return s
}
1120688
func (self *Failure) UpsertFailure(req *request.Request) bool {
	self.RWMutex.Lock()
	defer self.RWMutex.Unlock()
	if self.list[req.Unique()] != nil {
		return false
	}
	self.list[req.Unique()] = req
	return true
}
601759
func (t *Task) Fail() error {
	return t.guardResolution(func() error {
		return t.lifecycle.Abandon(t)
	})
}
28874
func (r *SyncResult) Fail(err error, msg string) {
	r.Error, r.Message = err, msg
}
1343206
func (s *TrainingJob) SetFailureReason(v string) *TrainingJob {
	s.FailureReason = &v
	return s
}
93313
func (s *BusinessReport) SetFailureCode(v string) *BusinessReport {
	s.FailureCode = &v
	return s
}
945312
func (s *LabelingJobSummary) SetFailureReason(v string) *LabelingJobSummary {
	s.FailureReason = &v
	return s
}
274363
func (b *Backend) SetStateFailure(signature *tasks.Signature, err string) error {
	update := bson.M{"state": tasks.StateFailure, "error": err}
	return b.updateState(signature, update)
}
444629
func (b *ExponentialBackoff) Failure(event Event, err error) bool {
	atomic.AddUint64(&b.failures, 1)
	return false
}