Skip to content

Commit

Permalink
Merge pull request #545 from forcedotcom/545-log-traces
Browse files Browse the repository at this point in the history
No stacktraces in logs when plugins throw exceptions
  • Loading branch information
gschueler committed Sep 18, 2013
2 parents 324e4f0 + 721cb25 commit e5f6b54
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit e5f6b54

Please sign in to comment.