提交 f1f7d70f 编写于 作者: K kohsuke

improved error diagnostics, as JDK doesn't tell us where we are loading the bits from

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15321 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a3bac8aa
......@@ -33,6 +33,7 @@ import hudson.lifecycle.Lifecycle;
import hudson.util.DaemonThreadFactory;
import hudson.util.TextFile;
import hudson.util.VersionNumber;
import hudson.util.IOException2;
import static hudson.util.TimeUnit2.DAYS;
import net.sf.json.JSONObject;
import org.acegisecurity.Authentication;
......@@ -568,9 +569,13 @@ public class UpdateCenter extends AbstractModelObject {
OutputStream out = new FileOutputStream(tmp);
LOGGER.info("Downloading "+job.getName());
while((len=in.read(buf))>=0) {
out.write(buf,0,len);
job.status = job.new Installing(total==-1 ? -1 : in.getCount()*100/total);
try {
while((len=in.read(buf))>=0) {
out.write(buf,0,len);
job.status = job.new Installing(total==-1 ? -1 : in.getCount()*100/total);
}
} catch (IOException e) {
throw new IOException2("Failed to load "+src+" to "+tmp,e);
}
in.close();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册