Navigation Menu

Skip to content

Commit

Permalink
[JENKINS-46259] - Log all linkage errors during user requests (#186)
Browse files Browse the repository at this point in the history
Log all linkage errors during user requests
  • Loading branch information
olivergondza authored and oleg-nenashev committed Aug 17, 2017
1 parent 967bd94 commit 15e28c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/hudson/remoting/UserRequest.java
Expand Up @@ -51,6 +51,8 @@
*/
final class UserRequest<RSP,EXC extends Throwable> extends Request<UserResponse<RSP,EXC>,EXC> {

private static final Logger LOGGER = Logger.getLogger(UserRequest.class.getName());

private final byte[] request;

@Nonnull
Expand Down Expand Up @@ -180,7 +182,7 @@ protected UserResponse<RSP,EXC> perform(Channel channel) throws EXC {
try {
o = deserialize(channel,request,cl);
} catch (ClassNotFoundException e) {
throw new ClassNotFoundException("Failed to deserialize the Callable object. Perhaps you needed to implement DelegatingCallable?",e);
throw new ClassNotFoundException("Failed to deserialize the Callable object. Perhaps you needed to implement DelegatingCallable?", e);
} catch (RuntimeException e) {
// if the error is during deserialization, throw it in one of the types Channel.call will
// capture its call site stack trace. See
Expand All @@ -204,6 +206,9 @@ protected UserResponse<RSP,EXC> perform(Channel channel) throws EXC {
} finally {
Thread.currentThread().setContextClassLoader(old);
}
} catch (LinkageError e) {
LOGGER.log(Level.WARNING, "LinkageError while performing " + toString(), e);
throw e;
} finally {
Channel.setCurrent(oldc);
}
Expand Down

0 comments on commit 15e28c2

Please sign in to comment.