List of usage examples for org.apache.commons.lang3.exception ContextedException ContextedException
public ContextedException(final String message, final Throwable cause)
From source file:com.rodaxsoft.mailgun.AbstractMailgunRoutine.java
/** * Returns a connected REST connection object * @param apiKey The API key// ww w.j a v a 2s .co m * @return A connected REST connection object * @throws ContextedException if connection error occurs */ protected RESTConnection restConnection(String apiKey) throws ContextedException { try { return RESTConnectionFactory.getRESTConnection().connect(account.getBaseUri(), apiKey); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new ContextedException("Instantiation Error", e).addContextValue("baseUri", account.getBaseUri()) .addContextValue("apiKey", apiKey); } }