// OnActivityFailedTimedOutCanceled builds a composed decider that fires when a matching activity fails, times out, or is canceled.
13913
func OnActivityFailedTimedOutCanceled(activityName string, deciders ...Decider) Decider {
	return OnActivityEvents(activityName, []string{
		swf.EventTypeActivityTaskFailed,
		swf.EventTypeActivityTaskTimedOut,
		swf.EventTypeActivityTaskCanceled,
		swf.EventTypeScheduleActivityTaskFailed,
	}, deciders...)
}
1213911
func OnActivityFailed(activityName string, deciders ...Decider) Decider {
	return OnActivityEvents(activityName, []string{
		swf.EventTypeActivityTaskFailed,
		swf.EventTypeScheduleActivityTaskFailed,
	}, deciders...)
}
440054
func (t *Tab) DidNavigationFail() (bool, string) {
	// if loadTimeData doesn't exist, or we get a js error, this means no error occurred.
	rro, err := t.EvaluateScript("loadTimeData.data_.errorCode")
	if err != nil {
		return false, ""
	}

	if val, ok := rro.Value.(string); ok {
		return true, val
	}

	return false, ""
}
453601
func FailAtEndSequentialChecker(checkers []StatusChecker) (checker StatusChecker) {
	f := func() Status {
		result := Status{
			GoodToGo: true,
			Message:  "OK",
		}
		for i := range checkers {
			status := checkers[i].RunCheck()
			if !status.GoodToGo {
				result.GoodToGo = false
				if result.Message == "OK" {
					result.Message = status.Message
				} else {
					result.Message += "\n" + status.Message
				}
			}
		}
		return result
	}
	return f
}
971816
func (p *Peer) LastActivity() time.Time {
	p.RLock()
	defer p.RUnlock()
	return p.lastActivity
}
1020752
func (controller *LocalController) OnValidationFail(ctx context.Context, err error) error {
	return controller.moveToErrorDir(ctx)
}
1222330
func NewTimeoutError(message string, retryAfterSeconds int) *StatusError {
	return &StatusError{metav1.Status{
		Status:  metav1.StatusFailure,
		Code:    http.StatusGatewayTimeout,
		Reason:  metav1.StatusReasonTimeout,
		Message: fmt.Sprintf("Timeout: %s", message),
		Details: &metav1.StatusDetails{
			RetryAfterSeconds: int32(retryAfterSeconds),
		},
	}}
}
1188345
func OnActivityStarted(activityName string, deciders ...Decider) Decider {
	return OnActivityEvents(activityName, []string{
		swf.EventTypeActivityTaskStarted,
	}, deciders...)
}
789908
func (c *Client) RespondActivityTaskFailed(request RespondActivityTaskFailedRequest) error {
	err := c.swfReqNoResponse("RespondActivityTaskFailed", request)
	return err
}
329078
func (this *Future) OnFailure(callback func(v interface{})) *Future {
	this.addCallback(callback, CALLBACK_FAIL)
	return this
}
589745
func (api *NFSAPI) AsyncSleepWhileCopying(id int64, timeout time.Duration, maxRetry int) (chan (interface{}), chan (interface{}), chan (error)) {
	handler := waitingForAvailableFunc(func() (hasAvailable, error) {
		return api.Read(id)
	}, maxRetry)
	return poll(handler, timeout)
}
1192198
func (n *NotifyRouter) HandleFSActivity(activity keybase1.FSNotification) {
	if n == nil {
		return
	}
	// For all connections we currently have open...
	n.cm.ApplyAll(func(id ConnectionID, xp rpc.Transporter) bool {
		// If the connection wants the `Kbfsdesktop` notification type
		if n.getNotificationChannels(id).Kbfsdesktop {
			// In the background do...
			go func() {
				// A send of a `FSActivity` RPC with the notification
				(keybase1.NotifyFSClient{
					Cli: rpc.NewClient(xp, NewContextifiedErrorUnwrapper(n.G()), nil),
				}).FSActivity(context.Background(), activity)
			}()
		}
		return true
	})
	n.runListeners(func(listener NotifyListener) {
		listener.FSActivity(activity)
	})
}
106356
func OnChildStarted(deciders ...Decider) Decider {
	return func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {
		switch *h.EventType {
		case swf.EventTypeChildWorkflowExecutionStarted:
			logf(ctx, "at=on-child-started")
			return NewComposedDecider(deciders...)(ctx, h, data)
		}
		return ctx.Pass()
	}
}
977652
func (s *DefaultSyncer) OnFailedSync(res *RespSync, err error) (time.Duration, error) {
	return 10 * time.Second, nil
}
882743
func (this *Promise) OnFailure(callback func(v interface{})) *Promise {
	this.Future.OnFailure(callback)
	return this
}
1016208
func OnStartTimerFailed(timer string, deciders ...Decider) Decider {
	return func(ctx *FSMContext, h *swf.HistoryEvent, data interface{}) Outcome {
		switch *h.EventType {
		case swf.EventTypeStartTimerFailed:
			if *h.StartTimerFailedEventAttributes.TimerId == timer {
				logf(ctx, "at=on-start-timer-failed timer=%q cause=%q", *h.StartTimerFailedEventAttributes.TimerId, *h.StartTimerFailedEventAttributes.Cause)
				return NewComposedDecider(deciders...)(ctx, h, data)
			}
		}
		return ctx.Pass()
	}
}
595690
func WithFailedAuthenticationAudit(failedHandler http.Handler, sink audit.Sink, policy policy.Checker) http.Handler {
	if sink == nil || policy == nil {
		return failedHandler
	}
	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
		req, ev, omitStages, err := createAuditEventAndAttachToContext(req, policy)
		if err != nil {
			utilruntime.HandleError(fmt.Errorf("failed to create audit event: %v", err))
			responsewriters.InternalError(w, req, errors.New("failed to create audit event"))
			return
		}
		if ev == nil {
			failedHandler.ServeHTTP(w, req)
			return
		}

		ev.ResponseStatus = &metav1.Status{}
		ev.ResponseStatus.Message = getAuthMethods(req)
		ev.Stage = auditinternal.StageResponseStarted

		rw := decorateResponseWriter(w, ev, sink, omitStages)
		failedHandler.ServeHTTP(rw, req)
	})
}