<p>
Set a default policy with some explicit handlers for specific exceptions.
</p>
961555
public static final RetryPolicy retryByException(RetryPolicy defaultPolicy,
                                                   Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap) {
    return new ExceptionDependentRetry(defaultPolicy, exceptionToPolicyMap);
  }
68032
public void disable() {
        enabled = false;

        // It's possible that another uncaught exception handler was installed 'over' us.
        // Whether or not it wrapped us, we have no control over what other classes do, and
        // so we can only remove ourselves if we are still the ('top most') default handler.
        // The 'enabled' boolean exists to ensure we no longer handle uncaught exceptions
        // even in the scenario where we are wrapped.
        Thread.UncaughtExceptionHandler currentHandler = Thread.getDefaultUncaughtExceptionHandler();
        if (currentHandler == this) {
            Thread.setDefaultUncaughtExceptionHandler(defaultExceptionHandler);
        }
    }
374321
public void setException(Throwable exception) {
    this.exception = exception;

    if (handlers != null) {
      for (IsSimplePromiseResponseHandler<T> h : handlers) {
        h.onResponse(this);
      }
    }
  }
540231
public void setDefault() {
        try {
            TelephonyManager telephonyManager = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE);
            String phone = telephonyManager.getLine1Number();
            if (phone != null && !phone.isEmpty()) {
                this.setNumber(phone);
            } else {
                String iso = telephonyManager.getNetworkCountryIso();
                setEmptyDefault(iso);
            }
        } catch (SecurityException e) {
            setEmptyDefault();
        }
    }
1015202
protected void configureDefaults() throws Exception
    {
        //next, configure default settings
        for (int i=0;i<_configurations.length;i++)
        {
            _configurations[i].setWebApplicationContext(this);
            _configurations[i].configureDefaults();
        }
    }
878028
protected <E extends Throwable> Set<ATError> handleException(E e, Log logger, 
			String key, String messageKey, String defaultMessagePrefix) {
		return handleException(e, logger, null, key, null, defaultMessagePrefix, new Object[] {});
	}
390330
void setException(Throwable theException) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "setException - Future object: " + this, theException);
        }

        // set exception, we are done
        ivException = theException;
        done(); // F743-11774
    }
380955
def setThrowException(self, setting):
        
        if setting:
            self._throwException = True
            self._findFailedResponse = "ABORT"
        else:
            self._throwException = False
            self._findFailedResponse = "SKIP"
492694
def _set_defaults(self, log_level=logging.INFO, redirect_stdout=False):
        """"""

        # Remove all previous handlers
        for handler in self.handlers[:]:
            self.removeHandler(handler)

        # Set levels
        self.setLevel(logging.DEBUG)

        # Set up the stdout handler
        self.fh = None
        self.sh = logging.StreamHandler()
        self.sh.emit = colored_formatter
        self.addHandler(self.sh)

        self.sh.setLevel(log_level)

        # warnings.showwarning = self._show_warning

        # Redirects all stdout to the logger
        if redirect_stdout:
            sys.stdout = LoggerStdout(self._print)

        # Catches exceptions
        sys.excepthook = self._catch_exceptions
923951
public void setExceptions(java.util.Collection<RootCauseException> exceptions) {
        if (exceptions == null) {
            this.exceptions = null;
            return;
        }

        this.exceptions = new java.util.ArrayList<RootCauseException>(exceptions);
    }
400365
public void handleRetry(Throwable cause) {
    try {
      this.retryPolicy.retry(connectionState, retryHandler, connectionFailHandler);
    } catch (RetryPolicy.RetryCancelled retryCancelled) {
      this.getNettyPromise().setFailure(cause);
    }
  }
1332098
def _defaultErrorHandler(varBinds, **context):
        """"""
        errors = context.get('errors')

        if errors:
            err = errors[-1]
            raise err['error']
616020
public static void setDefaultExecutor(Executor executor) {
        Class<?> c = null;
        Field field = null;
        try {
            c = Class.forName("android.os.AsyncTask");
            field = c.getDeclaredField("sDefaultExecutor");
            field.setAccessible(true);
            field.set(null, executor);
            field.setAccessible(false);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
            Log.e("IllegalArgumentException", e);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            Log.e("ClassNotFoundException", e);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
            Log.e("NoSuchFieldException", e);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
            Log.e("IllegalAccessException", e);
        }
    }
926003
private Object defaultHandling(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker) throws Throwable {
		return circuitBreaker.executeCheckedSupplier(proceedingJoinPoint::proceed);
	}
1356260
void setDefaults() {
        // If no ClassLoaders are specified, use the TCCL
        // Ensure we default this BEFORE defaulting the extension loader, as
        // the loader needs a CL to be created
        if (this.getClassLoaders() == null) {
            final ClassLoader tccl = SecurityActions.getThreadContextClassLoader();
            if (log.isLoggable(Level.FINER)) {
                log.finer("User has not defined an explicit " + ClassLoader.class.getSimpleName()
                    + "; defaulting to the TCCL: " + tccl);
            }
            final Collection<ClassLoader> tcclCollection = new ArrayList<ClassLoader>(1);
            // Adjust for the bootstrap CL, which may be denoted as null in some JVM impls
            if (tccl != null) {
                tcclCollection.add(tccl);
            } else {
                tcclCollection.add(ClassLoader.getSystemClassLoader());
            }
            this.classLoaders = tcclCollection;
        }

        // Adjust the CLs to be sure of no duplicate or null references (which may indicate
        // the bootstrap CL, so get to the system CL)
        final Collection<ClassLoader> adjustedCls = new HashSet<ClassLoader>();
        for (ClassLoader cl : this.classLoaders) {

            // Adjust for null references
            if (cl == null) {
                cl = ClassLoader.getSystemClassLoader();
            }

            // Add to the set, which will restrict duplicates
            adjustedCls.add(cl);
        }
        this.classLoaders = adjustedCls;

        // If no extension loader is present, create one
        if (getExtensionLoader() == null) {
            final ExtensionLoader loader = createDefaultExtensionLoader();
            if (log.isLoggable(Level.FINER)) {
                log.finer("User has not defined an explicit " + ExtensionLoader.class.getSimpleName()
                    + "; defaulting to " + loader);
            }
            this.extensionLoader(loader);
        }
    }
383838
def set_default(cls, rules):
    """"""
    if not isinstance(rules, JarRules):
      raise ValueError('The default rules must be a JarRules instance.')
    cls._DEFAULT = rules
773381
public function setDefaultHandler($name)
    {
        if (!array_key_exists($name, $this->logRegistry)) {
            throw new \Exception('LogHandler named ['.$name.'] does not exist');
        }
        $this->defaultLogHandler = $name;
    }