public ProxyException(Throwable cause) { super(cause.toString()); // use toString() to capture the class name and error message setStackTrace(cause.getStackTrace()); // wrap all the chained exceptions if(cause.getCause()!=null) initCause(new ProxyException(cause.getCause())); }
public ProxyException(@Nonnull Throwable cause) { super(cause.toString()); // use toString() to capture the class name and error message setStackTrace(cause.getStackTrace()); // wrap all the chained exceptions if(cause.getCause()!=null) initCause(new ProxyException(cause.getCause())); for (Throwable suppressed : cause.getSuppressed()) { addSuppressed(new ProxyException(suppressed)); } }
public RemotableSVNErrorMessage(SVNErrorCode code, String message, Throwable cause) { super(code, message == null ? "" : message, new Object[]{}, new ProxyException(cause), 0); } }
/** * Makes sure non-serializable exceptions are gracefully handled. * * HUDSON-1041. */ public void test1() throws Throwable { try { channel.call(new Failure()); } catch (ProxyException p) { // verify that we got the right kind of exception assertTrue(p.getMessage().contains("NoneSerializableException")); assertTrue(p.getMessage().contains("message1")); ProxyException nested = p.getCause(); assertTrue(nested.getMessage().contains("SocketException")); assertTrue(nested.getMessage().contains("message2")); assertNull(nested.getCause()); } }
public RemotableSVNErrorMessage(SVNErrorCode code, Throwable cause) { super(code, "", new Object[]{}, new ProxyException(cause), 0); }
public ProxyException(Throwable cause) { super(cause.toString()); // use toString() to capture the class name and error message setStackTrace(cause.getStackTrace()); // wrap all the chained exceptions if(cause.getCause()!=null) initCause(new ProxyException(cause.getCause())); }
Command(Channel channel, @CheckForNull Throwable cause) { // Command object needs to be deserializable on the other end without requiring custom classloading, // so we wrap this in ProxyException this.createdAt = new Source(cause != null ? new ProxyException(cause) : null); }
public ProxyException(Throwable cause) { super(cause.toString()); // use toString() to capture the class name and error message setStackTrace(cause.getStackTrace()); // wrap all the chained exceptions if(cause.getCause()!=null) initCause(new ProxyException(cause.getCause())); }
public ErrorAction(@Nonnull Throwable error) { if (isUnserializableException(error)) { error = new ProxyException(error); } this.error = error; }
@Override public TaskResult call() throws ProxyException { try { return doCall(); } catch (Exception ex) { // JENKINS-50760 // JEP-200 restricts the classes allowed to be serialized with XStream to a whitelist. // The task being executed in doCall may throw some exceptions from the third party libraries, // which will cause SecurityException when it's transferred from the slave back to the master. // We catch the exception and wrap the stack trace in a ProxyException which can // be serialized properly. throw new ProxyException(ex); } }
} catch (NotSerializableException x) { response = serialize(new ProxyException(e), channel);
} catch (NotSerializableException x) { response = serialize(new ProxyException(e), channel);
} catch (NotSerializableException x) { response = serialize(new ProxyException(e), channel);
byte[] proxyResponse = serialize(new ProxyException(e), channel); return new ExceptionResponse<>(rawResponse, proxyResponse); } catch (NotSerializableException x) { response = serialize(new ProxyException(e), channel);