Instantiates an exception to be thrown later.
519279
public function makeException()
    {
        // make exception based on the status code
        $this->thrownException =
            new PlivoResponseException(
                null, null, null,
                $this->decodedContent, $this->statusCode);

        echo $this->thrownException->getMessage();
    }
257313
private void doBefore() throws Throwable { //NOSONAR

        this.repository = this.createRepository();
        doStateTransition(State.CREATED);
        this.initialize();
        doStateTransition(State.INITIALIZED);
    }
239681
public static void main(String[] args) throws Throwable {

        final Exception exceptionToThrowLater = new Exception("Raygun4Java test exception");

        // sets the global unhandled exception handler
        Thread.setDefaultUncaughtExceptionHandler(MyExceptionHandler.instance());

        MyExceptionHandler.getClient().recordBreadcrumb("App starting up");

        RaygunIdentifier userIdentity = new RaygunIdentifier("a@b.com")
                .withEmail("a@b.com")
                .withFirstName("Foo")
                .withFullName("Foo Bar")
                .withAnonymous(false)
                .withUuid(UUID.randomUUID().toString());
        MyExceptionHandler.getClient().setUser(userIdentity);

        new Thread(new Runnable() {
            @Override
            public void run() {
                MyExceptionHandler.getClient().recordBreadcrumb("different thread starting");

                // note that use info not set on this thread

                try {
                    MyExceptionHandler.getClient().recordBreadcrumb("throwing exception");
                    throw exceptionToThrowLater;
                } catch (Exception e) {
                    MyExceptionHandler.getClient().recordBreadcrumb("handling exception");

                    Map<String, String> customData = new HashMap<String, String>();
                    customData.put("thread id", "" + Thread.currentThread().getId());
                    MyExceptionHandler.getClient()
                            .withTag("thrown from thread")
                            .withTag("no user withData")
                            .withData("thread id", "" + Thread.currentThread().getId())
                            .send(exceptionToThrowLater);

                    // this should appear in the raygun console as its already been sed
                    MyExceptionHandler.getClient().recordBreadcrumb("This should not appear because we're sending the same exception on the same thread");
                    Set<String> tags = new HashSet<String>();
                    tags.add("should not appear in console");
                    MyExceptionHandler.getClient().send(exceptionToThrowLater, tags);
                }

                // test offline storage by breaking the proxy
                RaygunSettings.getSettings().setHttpProxy("nothing here", 80);

                System.out.println("No Send below this line");
                MyExceptionHandler.getClient().send(new Exception("occurred while offline offline"));
                System.out.println("No Send above this lines ^");

                // fix the proxy and send offline data
                RaygunSettings.getSettings().setHttpProxy(null, 80);
                MyExceptionHandler.getClient().send(new Exception("This should trigger offline"));

            }
        }).start();

        MyExceptionHandler.getClient().recordBreadcrumb("Throwing exception on main thread");
        throw exceptionToThrowLater;
    }
347484
public AbstractQueue<ID, DATA> init() throws Exception {
        if (observer != null) {
            observer.preInit(this);
        }
        try {
            return this;
        } finally {
            if (observer != null) {
                observer.postInit(this);
            }
        }
    }
120084
@Nonnull
    LessException createException( Throwable cause ) {
        LessException lessEx = cause.getClass() == LessException.class ? (LessException)cause : new LessException( cause );
        lessEx.addPosition( filename, line, column );
        return lessEx;
    }
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
    }
181836
public void start() throws Throwable
   {
      Context context = null;
      try
      {
         Properties properties = new Properties();
         properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort);
         context = new InitialContext(properties);
         context.rebind(VALIDATOR_FACTORY, new SerializableValidatorFactory(validatorFactory));
      }
      finally
      {
         try
         {
            if (context != null)
               context.close();
         }
         catch (NamingException ne)
         {
            // Ignore
         }
      }
   }
395126
def make_exception(method, e):
    """"""
    x = e.details()
    name = x[:x.find(':')].split('.')[-1]
    if name in globals():
        cls = globals()[name]
    else:
        cls = UnknownRpcException  # noqa

    return cls(method, e.code(), e.details())
788366
public static void throwException(Throwable t) {
        if (hasUnsafe()) {
            PlatformDependent0.throwException(t);
        } else {
            PlatformDependent.<RuntimeException>throwException0(t);
        }
    }
1236242
public IOException unwrapRemoteException() {
    try {
      Class<?> realClass = Class.forName(getClassName());
      return instantiateException(realClass.asSubclass(IOException.class));
    } catch(Exception e) {
      // cannot instantiate the original exception, just return this
    }
    return this;
  }
662667
private void throwSaxException(Exception src)
        throws SAXException
    {
        SAXParseException se = new SAXParseException(src.getMessage(), /*(Locator)*/ this, src);
        ExceptionUtil.setInitCause(se, src);
        if (mErrorHandler != null) {
            mErrorHandler.fatalError(se);
        }
        throw se;
    }
41412
public static <T> void throwIllegalStateExceptionIfAlreadyInstantiated(Class<T> clazz) {
        if (isInstantiated(clazz)) {
            throw new IllegalStateException(clazz.getSimpleName() + " has already been instantiated. Call SingletonMap.getInstance(" + clazz.getSimpleName() + ".class) to get the initialized instance.");
        }
    }
1007263
def set_exception(self, exception):
        """"""
        self._exception = exception
        self._result_set = True
        self._invoke_callbacks(self)
822678
private void instantiateIngest() throws IOException {
    InjectionHandler.processEvent(InjectionEvent.STANDBY_INSTANTIATE_INGEST);
    try {
      synchronized (ingestStateLock) {
        if (checkIngestState()) {
          LOG.info("Standby: Ingest for txid: " + currentSegmentTxId
              + " is already running");
          return;
        }
        assertState(StandbyIngestState.NOT_INGESTING);
        ingest = new Ingest(this, fsnamesys, confg, currentSegmentTxId);
        ingestThread = new Thread(ingest);
        ingestThread.setName("Ingest_for_" + currentSegmentTxId);
        ingestThread.start();
        currentIngestState = StandbyIngestState.INGESTING_EDITS;
      }
      LOG.info("Standby: Instatiated ingest for txid: " + currentSegmentTxId);
    } catch (IOException e) {
      setIngestFailures(ingestFailures + 1);
      currentIngestState = StandbyIngestState.NOT_INGESTING;
      throw e;
    }
  }
380946
public void start() throws Exception
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once");

        client.createContainers(queuePath);

        getInitialQueues();
        leaderLatch.start();

        service.submit
        (
            new Callable<Void>()
            {
                @Override
                public Void call() throws Exception
                {
                    while ( state.get() == State.STARTED )
                    {
                        try
                        {
                            Thread.sleep(policies.getThresholdCheckMs());
                            checkThreshold();
                        }
                        catch ( InterruptedException e )
                        {
                            // swallow the interrupt as it's only possible from either a background
                            // operation and, thus, doesn't apply to this loop or the instance
                            // is being closed in which case the while test will get it
                        }
                    }
                    return null;
                }
            }
        );
    }
535827
private static void createInstance() throws Exception {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "createInstance", null);

        try {
            Class cls = Class.forName(JsConstants.JS_ADMIN_FACTORY_CLASS);
            _instance = (JsAdminFactory) cls.newInstance();
        } catch (Exception e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".<clinit>", JsConstants.PROBE_10);
            SibTr.error(tc, "EXCP_DURING_INIT_SIEG0001", e);
            // TODO: HIGH: Is this the correct error?
            throw e;
        }

        if (tc.isEntryEnabled())
            SibTr.exit(tc, "createInstance");
    }
998094
public void sendException(Throwable throwable) {
        EventBuilder eventBuilder = new EventBuilder().withMessage(throwable.getMessage())
            .withLevel(Event.Level.ERROR)
            .withSentryInterface(new ExceptionInterface(throwable));
        sendEvent(eventBuilder);
    }