com.undefinedlabs.scope.deps.okhttp3.internal.connection.RouteException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scope-deps Show documentation
Show all versions of scope-deps Show documentation
Scope is a APM for tests to give engineering teams unprecedented visibility into their CI process to quickly
identify, troubleshoot and fix failed builds.
This artifact contains dependencies for Scope.
package com.undefinedlabs.scope.deps.okhttp3.internal.connection;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public final class RouteException extends RuntimeException {
private static final Method addSuppressedExceptionMethod;
static {
Method m;
try {
m = Throwable.class.getDeclaredMethod("addSuppressed", Throwable.class);
} catch (Exception e) {
m = null;
}
addSuppressedExceptionMethod = m;
}
private IOException lastException;
public RouteException(IOException cause) {
super(cause);
lastException = cause;
}
public IOException getLastConnectException() {
return lastException;
}
public void addConnectException(IOException e) {
addSuppressedIfPossible(e, lastException);
lastException = e;
}
private void addSuppressedIfPossible(IOException e, IOException suppressed) {
if (addSuppressedExceptionMethod != null) {
try {
addSuppressedExceptionMethod.invoke(e, suppressed);
} catch (InvocationTargetException | IllegalAccessException ignored) {
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy