]> source.dussan.org Git - sonarqube.git/commitdiff
Add missing log when review command fails to be executed
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 29 May 2012 06:28:12 +0000 (08:28 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 29 May 2012 06:28:12 +0000 (08:28 +0200)
sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java

index a2a73f25d9c968585e9a288ebf3b49e168a4ef82..f254097120a05beff09c5061b20e367347717764 100644 (file)
@@ -38,16 +38,16 @@ import org.sonar.api.rules.RulePriority;
 import org.sonar.api.rules.RuleRepository;
 import org.sonar.api.utils.ValidationMessages;
 import org.sonar.api.web.*;
+import org.sonar.api.workflow.Review;
+import org.sonar.api.workflow.internal.DefaultReview;
+import org.sonar.api.workflow.internal.DefaultWorkflowContext;
+import org.sonar.api.workflow.screen.Screen;
 import org.sonar.core.i18n.RuleI18nManager;
 import org.sonar.core.persistence.Database;
 import org.sonar.core.persistence.DatabaseMigrator;
 import org.sonar.core.purge.PurgeDao;
 import org.sonar.core.resource.ResourceIndexerDao;
 import org.sonar.core.workflow.WorkflowEngine;
-import org.sonar.api.workflow.internal.DefaultReview;
-import org.sonar.api.workflow.internal.DefaultWorkflowContext;
-import org.sonar.api.workflow.Review;
-import org.sonar.api.workflow.screen.Screen;
 import org.sonar.markdown.Markdown;
 import org.sonar.server.configuration.Backup;
 import org.sonar.server.configuration.ProfilesManager;
@@ -487,6 +487,11 @@ public final class JRubyFacade {
   }
 
   public void executeReviewCommand(String commandKey, DefaultReview review, DefaultWorkflowContext context, Map<String, String> parameters) {
-    getContainer().getComponentByType(WorkflowEngine.class).execute(commandKey, review, context, parameters);
+    try {
+      getContainer().getComponentByType(WorkflowEngine.class).execute(commandKey, review, context, parameters);
+    } catch (RuntimeException e) {
+      LoggerFactory.getLogger(JRubyFacade.class).error("Fail to execute command: " + commandKey + " on review " + review.getReviewId(), e);
+      throw e;
+    }
   }
 }