From f8caddbebfb8242af49ccebef9740a9c94c79958 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 15 Nov 2010 23:36:18 +0000 Subject: [PATCH] improved the diagnostics git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@36964 71c3de6d-444a-0410-be80-ed276b4c234a --- .../src/main/java/hudson/remoting/FastPipedInputStream.java | 4 +++- .../src/main/java/hudson/remoting/FastPipedOutputStream.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/remoting/src/main/java/hudson/remoting/FastPipedInputStream.java b/remoting/src/main/java/hudson/remoting/FastPipedInputStream.java index 6a9aa197df..9d55c7efe0 100644 --- a/remoting/src/main/java/hudson/remoting/FastPipedInputStream.java +++ b/remoting/src/main/java/hudson/remoting/FastPipedInputStream.java @@ -48,6 +48,8 @@ public class FastPipedInputStream extends InputStream { int writeLaps = 0; int writePosition = 0; + private final Throwable allocatedAt = new Throwable(); + /** * Creates an unconnected PipedInputStream with a default buffer size. */ @@ -78,7 +80,7 @@ public class FastPipedInputStream extends InputStream { private FastPipedOutputStream source() throws IOException { FastPipedOutputStream s = source.get(); - if (s==null) throw new IOException("Writer side has already been abandoned"); + if (s==null) throw (IOException)new IOException("Writer side has already been abandoned").initCause(allocatedAt); return s; } diff --git a/remoting/src/main/java/hudson/remoting/FastPipedOutputStream.java b/remoting/src/main/java/hudson/remoting/FastPipedOutputStream.java index e1b171ca6c..4aafda6d1a 100644 --- a/remoting/src/main/java/hudson/remoting/FastPipedOutputStream.java +++ b/remoting/src/main/java/hudson/remoting/FastPipedOutputStream.java @@ -46,6 +46,8 @@ public class FastPipedOutputStream extends OutputStream { */ private long written=0; + private final Throwable allocatedAt = new Throwable(); + /** * Creates an unconnected PipedOutputStream. */ @@ -75,7 +77,7 @@ public class FastPipedOutputStream extends OutputStream { private FastPipedInputStream sink() throws IOException { FastPipedInputStream s = sink.get(); - if (s==null) throw new IOException("Reader side has already been abandoned"); + if (s==null) throw (IOException)new IOException("Reader side has already been abandoned").initCause(allocatedAt); return s; } -- GitLab