Example usage for java.lang IllegalThreadStateException initCause

List of usage examples for java.lang IllegalThreadStateException initCause

Introduction

In this page you can find the example usage for java.lang IllegalThreadStateException initCause.

Prototype

public synchronized Throwable initCause(Throwable cause) 

Source Link

Document

Initializes the cause of this throwable to the specified value.

Usage

From source file:com.appdirect.sdk.support.FakeAppmarket.java

public void stop() {
    server.stop(0);// w  w w  . jav  a 2  s  .c  om
    if (backgroundThreadException != null) {
        IllegalThreadStateException illegalThreadStateException = new IllegalThreadStateException(
                "One of the FakeAppMarket's request thread threw an exception. This is bad.");
        illegalThreadStateException.initCause(backgroundThreadException);
        throw illegalThreadStateException;
    }
}