Skip to content
Permalink
Browse files

[FIXED JENKINS-20074] Do not report irrelevant exceptions thrown in t…

…he process of reporting a (possibly relevant) exception.

Merge branch 'uncaught-socket-exceptions-JENKINS-20074'

Conflicts:
	core/pom.xml
  • Loading branch information...
jglick committed Nov 4, 2013
2 parents b9e227e + 177b39a commit cd8791e8fd2b04cbd0fff5bbfd0ef1a90e7442a9
Showing with 13 additions and 2 deletions.
  1. +13 −2 core/src/main/java/hudson/init/impl/InstallUncaughtExceptionHandler.java
@@ -11,6 +11,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import org.kohsuke.stapler.Stapler;

/**
* @author Kohsuke Kawaguchi
@@ -22,8 +23,18 @@ public static void init(final Jenkins j) throws IOException {
@Override
public void reportException(Throwable e, ServletContext context, HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
req.setAttribute("javax.servlet.error.exception",e);
WebApp.get(j.servletContext).getSomeStapler()
.invoke(req,rsp, Jenkins.getInstance(), "/oops");
try {
WebApp.get(j.servletContext).getSomeStapler()
.invoke(req,rsp, Jenkins.getInstance(), "/oops");
} catch (ServletException x) {
if (!Stapler.isSocketException(x)) {
throw x;
}
} catch (IOException x) {
if (!Stapler.isSocketException(x)) {
throw x;
}
}
}
});
}

0 comments on commit cd8791e

Please sign in to comment.
You can’t perform that action at this time.