From a5264a5c3ac7f46dd374d7b83517b41e3c39cd26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Gond=C5=BEa?= Date: Thu, 17 Aug 2017 10:00:00 +0200 Subject: [PATCH] [JENKINS-46259] - Log all linkage errors during user requests (#186) Log all linkage errors during user requests --- src/main/java/hudson/remoting/UserRequest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/hudson/remoting/UserRequest.java b/src/main/java/hudson/remoting/UserRequest.java index 596bb21a6..d4fc76a58 100644 --- a/src/main/java/hudson/remoting/UserRequest.java +++ b/src/main/java/hudson/remoting/UserRequest.java @@ -51,6 +51,8 @@ */ final class UserRequest extends Request,EXC> { + private static final Logger LOGGER = Logger.getLogger(UserRequest.class.getName()); + private final byte[] request; @Nonnull @@ -180,7 +182,7 @@ protected UserResponse 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 @@ -204,6 +206,9 @@ protected UserResponse 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); }