Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
24aa2063
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24aa2063
编写于
12月 12, 2016
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replaced other usages of printStackTrace.
上级
7f4ce02e
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
78 addition
and
63 deletion
+78
-63
core/src/main/java/hudson/FilePath.java
core/src/main/java/hudson/FilePath.java
+1
-1
core/src/main/java/hudson/Proc.java
core/src/main/java/hudson/Proc.java
+1
-1
core/src/main/java/hudson/Util.java
core/src/main/java/hudson/Util.java
+1
-1
core/src/main/java/hudson/cli/CLICommand.java
core/src/main/java/hudson/cli/CLICommand.java
+3
-2
core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
+2
-1
core/src/main/java/hudson/model/AbstractBuild.java
core/src/main/java/hudson/model/AbstractBuild.java
+3
-4
core/src/main/java/hudson/model/AbstractProject.java
core/src/main/java/hudson/model/AbstractProject.java
+2
-2
core/src/main/java/hudson/model/AsyncAperiodicWork.java
core/src/main/java/hudson/model/AsyncAperiodicWork.java
+3
-2
core/src/main/java/hudson/model/AsyncPeriodicWork.java
core/src/main/java/hudson/model/AsyncPeriodicWork.java
+3
-2
core/src/main/java/hudson/model/Build.java
core/src/main/java/hudson/model/Build.java
+2
-1
core/src/main/java/hudson/model/Executor.java
core/src/main/java/hudson/model/Executor.java
+2
-1
core/src/main/java/hudson/model/FingerprintCleanupThread.java
.../src/main/java/hudson/model/FingerprintCleanupThread.java
+2
-1
core/src/main/java/hudson/model/Run.java
core/src/main/java/hudson/model/Run.java
+2
-5
core/src/main/java/hudson/model/TaskThread.java
core/src/main/java/hudson/model/TaskThread.java
+2
-1
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
+5
-4
core/src/main/java/hudson/os/solaris/ZFSInstaller.java
core/src/main/java/hudson/os/solaris/ZFSInstaller.java
+3
-2
core/src/main/java/hudson/scm/SCM.java
core/src/main/java/hudson/scm/SCM.java
+2
-1
core/src/main/java/hudson/slaves/CommandLauncher.java
core/src/main/java/hudson/slaves/CommandLauncher.java
+6
-5
core/src/main/java/hudson/slaves/SlaveComputer.java
core/src/main/java/hudson/slaves/SlaveComputer.java
+5
-4
core/src/main/java/hudson/tasks/ArtifactArchiver.java
core/src/main/java/hudson/tasks/ArtifactArchiver.java
+2
-2
core/src/main/java/hudson/tasks/CommandInterpreter.java
core/src/main/java/hudson/tasks/CommandInterpreter.java
+5
-4
core/src/main/java/hudson/tasks/Fingerprinter.java
core/src/main/java/hudson/tasks/Fingerprinter.java
+2
-1
core/src/main/java/hudson/tasks/Maven.java
core/src/main/java/hudson/tasks/Maven.java
+1
-1
core/src/main/java/hudson/triggers/SCMTrigger.java
core/src/main/java/hudson/triggers/SCMTrigger.java
+2
-1
core/src/main/java/hudson/util/RemotingDiagnostics.java
core/src/main/java/hudson/util/RemotingDiagnostics.java
+1
-1
core/src/main/java/hudson/util/SecretRewriter.java
core/src/main/java/hudson/util/SecretRewriter.java
+2
-1
core/src/main/java/jenkins/PluginSubtypeMarker.java
core/src/main/java/jenkins/PluginSubtypeMarker.java
+2
-3
core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java
...jenkins/management/AsynchronousAdministrativeMonitor.java
+2
-1
core/src/main/java/jenkins/model/Jenkins.java
core/src/main/java/jenkins/model/Jenkins.java
+1
-4
core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java
...c/main/java/jenkins/security/RekeySecretAdminMonitor.java
+2
-1
core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
...rc/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
+2
-1
core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
...jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
+2
-1
core/src/main/resources/META-INF/upgrade/Functions.hint
core/src/main/resources/META-INF/upgrade/Functions.hint
+2
-0
未找到文件。
core/src/main/java/hudson/FilePath.java
浏览文件 @
24aa2063
...
...
@@ -831,7 +831,7 @@ public final class FilePath implements Serializable {
return
true
;
}
catch
(
IOException
x
)
{
if
(
listener
!=
null
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to download "
+
archive
+
" from agent; will retry from master"
));
listener
.
error
(
"Failed to download "
+
archive
+
" from agent; will retry from master"
).
print
(
Functions
.
printThrowable
(
x
));
}
}
}
...
...
core/src/main/java/hudson/Proc.java
浏览文件 @
24aa2063
...
...
@@ -159,7 +159,7 @@ public abstract class Proc {
kill
();
}
}
catch
(
InterruptedException
|
IOException
|
RuntimeException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to join a process"
));
listener
.
error
(
"Failed to join a process"
).
print
(
Functions
.
printThrowable
(
x
));
}
}
});
...
...
core/src/main/java/hudson/Util.java
浏览文件 @
24aa2063
...
...
@@ -1367,7 +1367,7 @@ public class Util {
PrintStream
log
=
listener
.
getLogger
();
log
.
printf
(
"ln %s %s failed%n"
,
targetPath
,
new
File
(
baseDir
,
symlinkPath
));
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
log
);
log
.
print
(
Functions
.
printThrowable
(
e
)
);
}
}
...
...
core/src/main/java/hudson/cli/CLICommand.java
浏览文件 @
24aa2063
...
...
@@ -29,6 +29,7 @@ import hudson.ExtensionList;
import
hudson.ExtensionPoint
;
import
hudson.cli.declarative.CLIMethod
;
import
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
;
import
hudson.Functions
;
import
jenkins.util.SystemProperties
;
import
hudson.cli.declarative.OptionHandlerExtension
;
import
jenkins.model.Jenkins
;
...
...
@@ -298,7 +299,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable {
stderr
.
println
(
""
);
stderr
.
println
(
"ERROR: "
+
errorMsg
);
LOGGER
.
log
(
Level
.
WARNING
,
errorMsg
,
e
);
e
.
printStackTrace
(
stderr
);
stderr
.
print
(
Functions
.
printThrowable
(
e
)
);
return
1
;
}
finally
{
if
(
sc
!=
null
)
...
...
@@ -332,7 +333,7 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable {
return
new
ClientAuthenticationCache
(
channel
).
get
();
}
catch
(
IOException
e
)
{
stderr
.
println
(
"Failed to access the stored credential"
);
e
.
printStackTrace
(
stderr
);
// recover
stderr
.
print
(
Functions
.
printThrowable
(
e
)
);
// recover
}
return
Jenkins
.
ANONYMOUS
;
}
...
...
core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
浏览文件 @
24aa2063
...
...
@@ -27,6 +27,7 @@ import hudson.AbortException;
import
hudson.Extension
;
import
hudson.ExtensionComponent
;
import
hudson.ExtensionFinder
;
import
hudson.Functions
;
import
hudson.Util
;
import
hudson.cli.CLICommand
;
import
hudson.cli.CloneableCLICommand
;
...
...
@@ -269,7 +270,7 @@ public class CLIRegisterer extends ExtensionFinder {
stderr
.
println
(
""
);
stderr
.
println
(
"ERROR: "
+
errorMsg
);
LOGGER
.
log
(
Level
.
WARNING
,
errorMsg
,
e
);
e
.
printStackTrace
(
stderr
);
stderr
.
print
(
Functions
.
printThrowable
(
e
)
);
return
1
;
}
}
...
...
core/src/main/java/hudson/model/AbstractBuild.java
浏览文件 @
24aa2063
...
...
@@ -633,7 +633,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
throw
(
InterruptedException
)
new
InterruptedException
().
initCause
(
e
);
}
catch
(
IOException
e
)
{
// checkout error not yet reported
e
.
printStackTrace
(
listener
.
getLogger
(
));
listener
.
getLogger
().
print
(
Functions
.
printThrowable
(
e
));
}
if
(
retryCount
==
0
)
// all attempts failed
...
...
@@ -749,7 +749,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
listener
.
error
(
"Step ‘"
+
buildStep
+
"’ failed: "
+
e
.
getMessage
());
}
else
{
String
msg
=
"Step ‘"
+
buildStep
+
"’ aborted due to exception: "
;
e
.
printStackTrace
(
listener
.
error
(
msg
));
listener
.
error
(
msg
).
print
(
Functions
.
printThrowable
(
e
));
LOGGER
.
log
(
WARNING
,
msg
,
e
);
}
...
...
@@ -784,8 +784,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
// Channel is closed, do not continue
reportBrokenChannel
(
listener
);
}
catch
(
RuntimeException
ex
)
{
ex
.
printStackTrace
(
listener
.
error
(
"Build step failed with exception"
));
listener
.
error
(
"Build step failed with exception"
).
print
(
Functions
.
printThrowable
(
ex
));
}
for
(
BuildStepListener
bsl
:
BuildStepListener
.
all
())
{
...
...
core/src/main/java/hudson/model/AbstractProject.java
浏览文件 @
24aa2063
...
...
@@ -1370,11 +1370,11 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
SCMPollListener
.
firePollingFailed
(
this
,
listener
,
e
);
return
NO_CHANGES
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
listener
.
fatalError
(
e
.
getMessage
()
));
listener
.
fatalError
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
SCMPollListener
.
firePollingFailed
(
this
,
listener
,
e
);
return
NO_CHANGES
;
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
AbstractProject_PollingABorted
()
));
listener
.
fatalError
(
Messages
.
AbstractProject_PollingABorted
()).
print
(
Functions
.
printThrowable
(
e
));
SCMPollListener
.
firePollingFailed
(
this
,
listener
,
e
);
return
NO_CHANGES
;
}
catch
(
RuntimeException
e
)
{
...
...
core/src/main/java/hudson/model/AsyncAperiodicWork.java
浏览文件 @
24aa2063
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.model
;
import
hudson.Functions
;
import
hudson.security.ACL
;
import
hudson.util.StreamTaskListener
;
import
java.io.File
;
...
...
@@ -119,9 +120,9 @@ public abstract class AsyncAperiodicWork extends AperiodicWork {
execute
(
l
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
l
.
fatalError
(
e
.
getMessage
()
));
l
.
fatalError
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
l
.
fatalError
(
"aborted"
));
l
.
fatalError
(
"aborted"
).
print
(
Functions
.
printThrowable
(
e
));
}
finally
{
stopTime
=
System
.
currentTimeMillis
();
try
{
...
...
core/src/main/java/hudson/model/AsyncPeriodicWork.java
浏览文件 @
24aa2063
package
hudson.model
;
import
hudson.Functions
;
import
hudson.security.ACL
;
import
hudson.util.StreamTaskListener
;
import
java.io.File
;
...
...
@@ -99,9 +100,9 @@ public abstract class AsyncPeriodicWork extends PeriodicWork {
execute
(
l
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
l
.
fatalError
(
e
.
getMessage
()
));
l
.
fatalError
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
l
.
fatalError
(
"aborted"
));
l
.
fatalError
(
"aborted"
).
print
(
Functions
.
printThrowable
(
e
));
}
finally
{
stopTime
=
System
.
currentTimeMillis
();
try
{
...
...
core/src/main/java/hudson/model/Build.java
浏览文件 @
24aa2063
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.model
;
import
hudson.Functions
;
import
hudson.Launcher
;
import
hudson.tasks.BuildStep
;
import
hudson.tasks.BuildWrapper
;
...
...
@@ -195,7 +196,7 @@ public abstract class Build <P extends Project<P,B>,B extends Build<P,B>>
performAllBuildSteps
(
listener
,
project
.
getPublishersList
(),
false
);
performAllBuildSteps
(
listener
,
project
.
getProperties
(),
false
);
}
catch
(
Exception
x
)
{
x
.
printStackTrace
(
listener
.
error
(
Messages
.
Build_post_build_steps_failed
()
));
listener
.
error
(
Messages
.
Build_post_build_steps_failed
()).
print
(
Functions
.
printThrowable
(
x
));
}
super
.
cleanUp
(
listener
);
}
...
...
core/src/main/java/hudson/model/Executor.java
浏览文件 @
24aa2063
...
...
@@ -24,6 +24,7 @@
package
hudson.model
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
hudson.Util
;
import
hudson.model.Queue.Executable
;
import
hudson.model.queue.Executables
;
...
...
@@ -289,7 +290,7 @@ public class Executor extends Thread implements ModelObject {
}
else
{
pw
.
println
(
"Termination trace follows:"
);
for
(
Computer
.
TerminationRequest
request
:
owner
.
getTerminatedBy
())
{
request
.
printStackTrace
(
pw
);
pw
.
print
(
Functions
.
printThrowable
(
request
)
);
}
}
}
...
...
core/src/main/java/hudson/model/FingerprintCleanupThread.java
浏览文件 @
24aa2063
...
...
@@ -25,6 +25,7 @@ package hudson.model;
import
hudson.Extension
;
import
hudson.ExtensionList
;
import
hudson.Functions
;
import
jenkins.model.Jenkins
;
import
org.jenkinsci.Symbol
;
...
...
@@ -113,7 +114,7 @@ public final class FingerprintCleanupThread extends AsyncPeriodicWork {
return
fp
.
trim
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
"Failed to process "
+
fingerprintFil
e
));
listener
.
error
(
"Failed to process "
+
fingerprintFile
).
print
(
Functions
.
printThrowable
(
e
));
return
false
;
}
}
...
...
core/src/main/java/hudson/model/Run.java
浏览文件 @
24aa2063
...
...
@@ -73,7 +73,6 @@ import java.io.OutputStream;
import
java.io.PrintWriter
;
import
java.io.RandomAccessFile
;
import
java.io.Reader
;
import
java.io.StringWriter
;
import
java.nio.charset.Charset
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
...
...
@@ -1865,7 +1864,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
if
(
e
instanceof
IOException
)
Util
.
displayIOException
((
IOException
)
e
,
listener
);
e
.
printStackTrace
(
listener
.
fatalError
(
e
.
getMessage
()
));
listener
.
fatalError
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
}
else
{
LOGGER
.
log
(
SEVERE
,
getDisplayName
()+
" failed to build and we don't even have a listener"
,
e
);
}
...
...
@@ -2194,9 +2193,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
delete
();
}
catch
(
IOException
ex
){
StringWriter
writer
=
new
StringWriter
();
ex
.
printStackTrace
(
new
PrintWriter
(
writer
));
req
.
setAttribute
(
"stackTraces"
,
writer
);
req
.
setAttribute
(
"stackTraces"
,
Functions
.
printThrowable
(
ex
));
req
.
getView
(
this
,
"delete-retry.jelly"
).
forward
(
req
,
rsp
);
return
;
}
...
...
core/src/main/java/hudson/model/TaskThread.java
浏览文件 @
24aa2063
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.model
;
import
hudson.Functions
;
import
hudson.console.AnnotatedLargeText
;
import
hudson.util.StreamTaskListener
;
...
...
@@ -131,7 +132,7 @@ public abstract class TaskThread extends Thread {
}
catch
(
InterruptedException
e
)
{
listener
.
getLogger
().
println
(
"Aborted"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
listener
.
getLogger
(
));
listener
.
getLogger
().
print
(
Functions
.
printThrowable
(
e
));
}
finally
{
listener
=
null
;
isRunning
=
false
;
...
...
core/src/main/java/hudson/model/WorkspaceCleanupThread.java
浏览文件 @
24aa2063
...
...
@@ -26,6 +26,7 @@ package hudson.model;
import
hudson.Extension
;
import
hudson.ExtensionList
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
jenkins.util.SystemProperties
;
import
hudson.Util
;
import
hudson.slaves.WorkspaceList
;
...
...
@@ -82,10 +83,10 @@ public class WorkspaceCleanupThread extends AsyncPeriodicWork {
try
{
check
=
shouldBeDeleted
(
item
,
ws
,
node
);
}
catch
(
IOException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to check "
+
node
.
getDisplayName
()
));
listener
.
error
(
"Failed to check "
+
node
.
getDisplayName
()).
print
(
Functions
.
printThrowable
(
x
));
continue
;
}
catch
(
InterruptedException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to check "
+
node
.
getDisplayName
()
));
listener
.
error
(
"Failed to check "
+
node
.
getDisplayName
()).
print
(
Functions
.
printThrowable
(
x
));
continue
;
}
if
(
check
)
{
...
...
@@ -94,9 +95,9 @@ public class WorkspaceCleanupThread extends AsyncPeriodicWork {
ws
.
deleteRecursive
();
WorkspaceList
.
tempDir
(
ws
).
deleteRecursive
();
}
catch
(
IOException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to delete "
+
ws
+
" on "
+
node
.
getDisplayName
()
));
listener
.
error
(
"Failed to delete "
+
ws
+
" on "
+
node
.
getDisplayName
()).
print
(
Functions
.
printThrowable
(
x
));
}
catch
(
InterruptedException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
"Failed to delete "
+
ws
+
" on "
+
node
.
getDisplayName
()
));
listener
.
error
(
"Failed to delete "
+
ws
+
" on "
+
node
.
getDisplayName
()).
print
(
Functions
.
printThrowable
(
x
));
}
}
}
...
...
core/src/main/java/hudson/os/solaris/ZFSInstaller.java
浏览文件 @
24aa2063
...
...
@@ -28,6 +28,7 @@ import com.sun.akuma.JavaVMArguments;
import
hudson.Launcher.LocalLauncher
;
import
hudson.Util
;
import
hudson.Extension
;
import
hudson.Functions
;
import
jenkins.util.SystemProperties
;
import
hudson.os.SU
;
import
hudson.model.AdministrativeMonitor
;
...
...
@@ -228,7 +229,7 @@ public class ZFSInstaller extends AdministrativeMonitor implements Serializable
try
{
datasetName
=
createZfsFileSystem
(
listener
,
username
,
password
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
listener
.
error
(
e
.
getMessage
()
));
listener
.
error
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
if
(
e
instanceof
ZFSException
)
{
ZFSException
ze
=
(
ZFSException
)
e
;
...
...
@@ -292,7 +293,7 @@ public class ZFSInstaller extends AdministrativeMonitor implements Serializable
}
}
catch
(
Exception
e
)
{
// if we let any exception from here, it will prevent Hudson from starting.
e
.
printStackTrace
(
listener
.
error
(
"Migration failed"
));
listener
.
error
(
"Migration failed"
).
print
(
Functions
.
printThrowable
(
e
));
}
// migration failed
return
new
MigrationFailedNotice
(
out
);
...
...
core/src/main/java/hudson/scm/SCM.java
浏览文件 @
24aa2063
...
...
@@ -28,6 +28,7 @@ import hudson.DescriptorExtensionList;
import
hudson.Extension
;
import
hudson.ExtensionPoint
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
hudson.Launcher
;
import
hudson.Util
;
import
hudson.model.AbstractBuild
;
...
...
@@ -673,7 +674,7 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
createEmptyChangeLog
(
changelogFile
,
(
TaskListener
)
listener
,
rootTag
);
return
true
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
e
.
getMessage
()
));
listener
.
error
(
e
.
getMessage
()).
print
(
Functions
.
printThrowable
(
e
));
return
false
;
}
}
...
...
core/src/main/java/hudson/slaves/CommandLauncher.java
浏览文件 @
24aa2063
...
...
@@ -27,6 +27,7 @@ import hudson.AbortException;
import
hudson.EnvVars
;
import
hudson.Util
;
import
hudson.Extension
;
import
hudson.Functions
;
import
hudson.model.Descriptor
;
import
hudson.model.Slave
;
import
jenkins.model.Jenkins
;
...
...
@@ -143,11 +144,11 @@ public class CommandLauncher extends ComputerLauncher {
LOGGER
.
info
(
"agent launched for "
+
computer
.
getDisplayName
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()
));
listener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()).
print
(
Functions
.
printThrowable
(
e
));
}
catch
(
RuntimeException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()
));
listener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()).
print
(
Functions
.
printThrowable
(
e
));
}
catch
(
Error
e
)
{
e
.
printStackTrace
(
listener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()
));
listener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()).
print
(
Functions
.
printThrowable
(
e
));
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
listener
);
...
...
@@ -159,14 +160,14 @@ public class CommandLauncher extends ComputerLauncher {
}
msg
=
hudson
.
model
.
Messages
.
Slave_UnableToLaunch
(
computer
.
getDisplayName
(),
msg
);
LOGGER
.
log
(
Level
.
SEVERE
,
msg
,
e
);
e
.
printStackTrace
(
listener
.
error
(
msg
));
listener
.
error
(
msg
).
print
(
Functions
.
printThrowable
(
e
));
if
(
_proc
!=
null
)
{
reportProcessTerminated
(
_proc
,
listener
);
try
{
ProcessTree
.
get
().
killAll
(
_proc
,
_cookie
);
}
catch
(
InterruptedException
x
)
{
x
.
printStackTrace
(
listener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()
));
listener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()).
print
(
Functions
.
printThrowable
(
x
));
}
}
}
...
...
core/src/main/java/hudson/slaves/SlaveComputer.java
浏览文件 @
24aa2063
...
...
@@ -25,6 +25,7 @@ package hudson.slaves;
import
hudson.AbortException
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
hudson.Util
;
import
hudson.console.ConsoleLogFilter
;
import
hudson.model.Computer
;
...
...
@@ -264,13 +265,13 @@ public class SlaveComputer extends Computer {
throw
e
;
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
taskListener
);
e
.
printStackTrace
(
taskListener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()
));
taskListener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()).
print
(
Functions
.
printThrowable
(
e
));
throw
e
;
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
(
taskListener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()
));
taskListener
.
error
(
Messages
.
ComputerLauncher_abortedLaunch
()).
print
(
Functions
.
printThrowable
(
e
));
throw
e
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
taskListener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()
));
taskListener
.
error
(
Messages
.
ComputerLauncher_unexpectedError
()).
print
(
Functions
.
printThrowable
(
e
));
throw
e
;
}
}
finally
{
...
...
@@ -494,7 +495,7 @@ public class SlaveComputer extends Computer {
// Orderly shutdown will have null exception
if
(
cause
!=
null
)
{
offlineCause
=
new
ChannelTermination
(
cause
);
cause
.
printStackTrace
(
taskListener
.
error
(
"Connection terminated"
));
taskListener
.
error
(
"Connection terminated"
).
print
(
Functions
.
printThrowable
(
cause
));
}
else
{
taskListener
.
getLogger
().
println
(
"Connection terminated"
);
}
...
...
core/src/main/java/hudson/tasks/ArtifactArchiver.java
浏览文件 @
24aa2063
...
...
@@ -28,6 +28,7 @@ import jenkins.MasterToSlaveFileCallable;
import
hudson.Launcher
;
import
hudson.Util
;
import
hudson.Extension
;
import
hudson.Functions
;
import
jenkins.util.SystemProperties
;
import
hudson.model.AbstractProject
;
import
hudson.model.Result
;
...
...
@@ -262,8 +263,7 @@ public class ArtifactArchiver extends Recorder implements SimpleBuildStep {
}
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
listener
.
error
(
Messages
.
ArtifactArchiver_FailedToArchive
(
artifacts
)));
listener
.
error
(
Messages
.
ArtifactArchiver_FailedToArchive
(
artifacts
)).
print
(
Functions
.
printThrowable
(
e
));
build
.
setResult
(
Result
.
FAILURE
);
return
;
}
...
...
core/src/main/java/hudson/tasks/CommandInterpreter.java
浏览文件 @
24aa2063
...
...
@@ -28,6 +28,7 @@ import hudson.Launcher;
import
hudson.Proc
;
import
hudson.Util
;
import
hudson.EnvVars
;
import
hudson.Functions
;
import
hudson.model.AbstractBuild
;
import
hudson.model.BuildListener
;
import
hudson.model.Node
;
...
...
@@ -93,7 +94,7 @@ public abstract class CommandInterpreter extends Builder {
script
=
createScriptFile
(
ws
);
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToProduceScript
()
));
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToProduceScript
()).
print
(
Functions
.
printThrowable
(
e
));
return
false
;
}
...
...
@@ -113,7 +114,7 @@ public abstract class CommandInterpreter extends Builder {
}
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
CommandInterpreter_CommandFailed
()
));
listener
.
fatalError
(
Messages
.
CommandInterpreter_CommandFailed
()).
print
(
Functions
.
printThrowable
(
e
));
}
return
r
==
0
;
}
finally
{
...
...
@@ -132,10 +133,10 @@ public abstract class CommandInterpreter extends Builder {
LOGGER
.
log
(
Level
.
FINE
,
"Script deletion failed"
,
e
);
}
else
{
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToDelete
(
script
))
);
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToDelete
(
script
)).
print
(
Functions
.
printThrowable
(
e
)
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToDelete
(
script
))
);
listener
.
fatalError
(
Messages
.
CommandInterpreter_UnableToDelete
(
script
)).
print
(
Functions
.
printThrowable
(
e
)
);
}
}
}
...
...
core/src/main/java/hudson/tasks/Fingerprinter.java
浏览文件 @
24aa2063
...
...
@@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableMap;
import
hudson.EnvVars
;
import
hudson.Extension
;
import
hudson.FilePath
;
import
hudson.Functions
;
import
jenkins.MasterToSlaveFileCallable
;
import
hudson.Launcher
;
import
jenkins.util.SystemProperties
;
...
...
@@ -137,7 +138,7 @@ public class Fingerprinter extends Recorder implements Serializable, DependencyD
Jenkins
.
getInstance
().
rebuildDependencyGraphAsync
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
Messages
.
Fingerprinter_Failed
()
));
listener
.
error
(
Messages
.
Fingerprinter_Failed
()).
print
(
Functions
.
printThrowable
(
e
));
build
.
setResult
(
Result
.
FAILURE
);
}
...
...
core/src/main/java/hudson/tasks/Maven.java
浏览文件 @
24aa2063
...
...
@@ -366,7 +366,7 @@ public class Maven extends Builder {
}
}
catch
(
IOException
e
)
{
Util
.
displayIOException
(
e
,
listener
);
e
.
printStackTrace
(
listener
.
fatalError
(
Messages
.
Maven_ExecFailed
())
);
listener
.
fatalError
(
Messages
.
Maven_ExecFailed
()).
print
(
Functions
.
printThrowable
(
e
)
);
return
false
;
}
startIndex
=
endIndex
+
1
;
...
...
core/src/main/java/hudson/triggers/SCMTrigger.java
浏览文件 @
24aa2063
...
...
@@ -27,6 +27,7 @@ package hudson.triggers;
import
antlr.ANTLRException
;
import
com.google.common.base.Preconditions
;
import
hudson.Extension
;
import
hudson.Functions
;
import
hudson.Util
;
import
hudson.console.AnnotatedLargeText
;
import
hudson.model.AbstractBuild
;
...
...
@@ -568,7 +569,7 @@ public class SCMTrigger extends Trigger<Item> {
logger
.
println
(
"No changes"
);
return
result
;
}
catch
(
Error
|
RuntimeException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
"Failed to record SCM polling for "
+
job
));
listener
.
error
(
"Failed to record SCM polling for "
+
job
).
print
(
Functions
.
printThrowable
(
e
));
LOGGER
.
log
(
Level
.
SEVERE
,
"Failed to record SCM polling for "
+
job
,
e
);
throw
e
;
}
finally
{
...
...
core/src/main/java/hudson/util/RemotingDiagnostics.java
浏览文件 @
24aa2063
...
...
@@ -143,7 +143,7 @@ public final class RemotingDiagnostics {
if
(
output
!=
null
)
pw
.
println
(
"Result: "
+
output
);
}
catch
(
Throwable
t
)
{
t
.
printStackTrace
(
pw
);
pw
.
print
(
Functions
.
printThrowable
(
t
)
);
}
return
out
.
toString
();
}
...
...
core/src/main/java/hudson/util/SecretRewriter.java
浏览文件 @
24aa2063
package
hudson.util
;
import
com.trilead.ssh2.crypto.Base64
;
import
hudson.Functions
;
import
hudson.model.TaskListener
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -169,7 +170,7 @@ public class SecretRewriter {
rewritten
++;
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
listener
.
error
(
"Failed to rewrite "
+
child
));
listener
.
error
(
"Failed to rewrite "
+
child
).
print
(
Functions
.
printThrowable
(
e
));
}
}
if
(
child
.
isDirectory
())
{
...
...
core/src/main/java/jenkins/PluginSubtypeMarker.java
浏览文件 @
24aa2063
...
...
@@ -23,6 +23,7 @@
*/
package
jenkins
;
import
hudson.Functions
;
import
hudson.Plugin
;
import
org.kohsuke.MetaInfServices
;
...
...
@@ -69,9 +70,7 @@ public class PluginSubtypeMarker extends AbstractProcessor {
try
{
write
(
e
);
}
catch
(
IOException
x
)
{
StringWriter
sw
=
new
StringWriter
();
x
.
printStackTrace
(
new
PrintWriter
(
sw
));
processingEnv
.
getMessager
().
printMessage
(
Kind
.
ERROR
,
sw
.
toString
(),
e
);
processingEnv
.
getMessager
().
printMessage
(
Kind
.
ERROR
,
Functions
.
printThrowable
(
x
),
e
);
}
}
}
...
...
core/src/main/java/jenkins/management/AsynchronousAdministrativeMonitor.java
浏览文件 @
24aa2063
package
jenkins.management
;
import
hudson.AbortException
;
import
hudson.Functions
;
import
hudson.console.AnnotatedLargeText
;
import
hudson.model.AdministrativeMonitor
;
import
hudson.model.TaskListener
;
...
...
@@ -125,7 +126,7 @@ public abstract class AsynchronousAdministrativeMonitor extends AdministrativeMo
}
catch
(
AbortException
e
)
{
listener
.
error
(
e
.
getMessage
());
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
(
listener
.
error
(
getName
()
+
" failed"
));
listener
.
error
(
getName
()
+
" failed"
).
print
(
Functions
.
printThrowable
(
e
));
LOGGER
.
log
(
Level
.
WARNING
,
getName
()
+
" failed"
,
e
);
}
}
...
...
core/src/main/java/jenkins/model/Jenkins.java
浏览文件 @
24aa2063
...
...
@@ -272,7 +272,6 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.net.BindException
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
...
...
@@ -3768,9 +3767,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
try
{
r
.
put
(
e
.
getKey
(),
e
.
getValue
().
get
(
endTime
-
System
.
currentTimeMillis
(),
TimeUnit
.
MILLISECONDS
));
}
catch
(
Exception
x
)
{
StringWriter
sw
=
new
StringWriter
();
x
.
printStackTrace
(
new
PrintWriter
(
sw
,
true
));
r
.
put
(
e
.
getKey
(),
Collections
.
singletonMap
(
"Failed to retrieve thread dump"
,
sw
.
toString
()));
r
.
put
(
e
.
getKey
(),
Collections
.
singletonMap
(
"Failed to retrieve thread dump"
,
Functions
.
printThrowable
(
x
)));
}
}
return
Collections
.
unmodifiableSortedMap
(
new
TreeMap
<
String
,
Map
<
String
,
String
>>(
r
));
...
...
core/src/main/java/jenkins/security/RekeySecretAdminMonitor.java
浏览文件 @
24aa2063
package
jenkins.security
;
import
hudson.Extension
;
import
hudson.Functions
;
import
hudson.init.InitMilestone
;
import
hudson.init.Initializer
;
import
hudson.model.TaskListener
;
...
...
@@ -152,7 +153,7 @@ public class RekeySecretAdminMonitor extends AsynchronousAdministrativeMonitor i
LOGGER
.
info
(
"Secret re-keying completed"
);
}
catch
(
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Fatal failure in re-keying secrets"
,
e
);
e
.
printStackTrace
(
listener
.
error
(
"Fatal failure in rewriting secrets"
));
listener
.
error
(
"Fatal failure in rewriting secrets"
).
print
(
Functions
.
printThrowable
(
e
));
}
}
...
...
core/src/main/java/jenkins/slaves/DefaultJnlpSlaveReceiver.java
浏览文件 @
24aa2063
...
...
@@ -3,6 +3,7 @@ package jenkins.slaves;
import
edu.umd.cs.findbugs.annotations.NonNull
;
import
hudson.ClassicPluginStrategy
;
import
hudson.Extension
;
import
hudson.Functions
;
import
hudson.TcpSlaveAgentListener.ConnectionFromCurrentPeer
;
import
hudson.Util
;
import
hudson.model.Computer
;
...
...
@@ -171,7 +172,7 @@ public class DefaultJnlpSlaveReceiver extends JnlpAgentReceiver {
computer
.
setChannel
(
event
.
getChannel
(),
state
.
getLog
(),
null
);
}
catch
(
IOException
|
InterruptedException
e
)
{
PrintWriter
logw
=
new
PrintWriter
(
state
.
getLog
(),
true
);
e
.
printStackTrace
(
logw
);
logw
.
print
(
Functions
.
printThrowable
(
e
)
);
IOUtils
.
closeQuietly
(
event
.
getChannel
());
}
}
...
...
core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
浏览文件 @
24aa2063
package
jenkins.slaves.restarter
;
import
hudson.Extension
;
import
hudson.Functions
;
import
hudson.model.Computer
;
import
hudson.model.TaskListener
;
import
hudson.remoting.Engine
;
...
...
@@ -93,7 +94,7 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
LOGGER
.
log
(
FINE
,
"Effective SlaveRestarter on {0}: {1}"
,
new
Object
[]
{
c
.
getName
(),
effective
});
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
(
listener
.
error
(
"Failed to install restarter"
));
listener
.
error
(
"Failed to install restarter"
).
print
(
Functions
.
printThrowable
(
e
));
}
}
...
...
core/src/main/resources/META-INF/upgrade/Functions.hint
0 → 100644
浏览文件 @
24aa2063
$t.printStackTrace($s) :: $s instance java.io.PrintStream && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));;
$t.printStackTrace($s) :: $s instance java.io.PrintWriter && $t instanceof Throwable => $s.print(hudson.Functions.printThrowable($t));;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录