-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #545 from forcedotcom/545-log-traces
No stacktraces in logs when plugins throw exceptions
- Loading branch information
Showing
1 changed file
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,27 +24,29 @@ | |
*/ | ||
package com.dtolabs.rundeck.core.execution.workflow.steps.node; | ||
|
||
import java.util.Map; | ||
|
||
import org.apache.log4j.Logger; | ||
|
||
import com.dtolabs.rundeck.core.common.INodeEntry; | ||
import com.dtolabs.rundeck.core.dispatcher.DataContextUtils; | ||
import com.dtolabs.rundeck.core.execution.ConfiguredStepExecutionItem; | ||
import com.dtolabs.rundeck.core.execution.StepExecutionItem; | ||
import com.dtolabs.rundeck.core.execution.workflow.StepExecutionContext; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PluginAdapterUtility; | ||
import com.dtolabs.rundeck.core.execution.workflow.steps.PluginStepContextImpl; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PropertyResolver; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PropertyResolverFactory; | ||
import com.dtolabs.rundeck.core.execution.workflow.steps.StepFailureReason; | ||
import com.dtolabs.rundeck.core.plugins.configuration.Describable; | ||
import com.dtolabs.rundeck.core.plugins.configuration.Description; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PluginAdapterUtility; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PropertyResolver; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PropertyResolverFactory; | ||
import com.dtolabs.rundeck.core.plugins.configuration.PropertyScope; | ||
import com.dtolabs.rundeck.core.utils.Converter; | ||
import com.dtolabs.rundeck.plugins.ServiceNameConstants; | ||
import com.dtolabs.rundeck.plugins.step.NodeStepPlugin; | ||
import com.dtolabs.rundeck.plugins.step.PluginStepContext; | ||
import com.dtolabs.rundeck.plugins.util.DescriptionBuilder; | ||
|
||
import java.util.Map; | ||
|
||
|
||
/** | ||
* NodeStepPluginAdapter implements NodeStepExecutor, and makes use of a {@link NodeStepPlugin} instance to perform the | ||
|
@@ -53,7 +55,7 @@ | |
* @author Greg Schueler <a href="mailto:[email protected]">[email protected]</a> | ||
*/ | ||
class NodeStepPluginAdapter implements NodeStepExecutor, Describable { | ||
|
||
protected static Logger log = Logger.getLogger(NodeStepPluginAdapter.class.getName()); | ||
|
||
@Override | ||
public Description getDescription() { | ||
|
@@ -100,11 +102,13 @@ public NodeStepResult executeNodeStep(final StepExecutionContext context, | |
try { | ||
plugin.executeNodeStep(pluginContext, config, node); | ||
} catch (RuntimeException e) { | ||
log.error("Uncaught runtime exception executing node step.", e); | ||
return new NodeStepResultImpl(e, | ||
StepFailureReason.PluginFailed, | ||
e.getMessage(), | ||
node); | ||
} catch (NodeStepException e){ | ||
log.error("Error executing node step.", e); | ||
return new NodeStepResultImpl(e, | ||
e.getFailureReason(), | ||
e.getMessage(), | ||
|