diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-07-12 11:39:23 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-07-21 12:22:10 +0200 |
commit | f01745f4663f2ebd4bd9e5b55e98335739a700a2 (patch) | |
tree | 5e60d627b46688025a712fc3955732fe7627d5df /server/sonar-ce/src/main/java | |
parent | b44daaf66b0ca8762f4223b77bef87213ea1f3b1 (diff) | |
download | sonarqube-f01745f4663f2ebd4bd9e5b55e98335739a700a2.tar.gz sonarqube-f01745f4663f2ebd4bd9e5b55e98335739a700a2.zip |
SONAR-9540 log MessageException message if task can't be finalized
so that the cause of the failure of the task is not lost in the void
Diffstat (limited to 'server/sonar-ce/src/main/java')
-rw-r--r-- | server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java index b5db945cb96..d52bed437f9 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/taskprocessor/CeWorkerImpl.java @@ -149,7 +149,12 @@ public class CeWorkerImpl implements CeWorker { try { queue.remove(task, status, taskResult, error); } catch (Exception e) { - LOG.error(format("Failed to finalize task with uuid '%s' and persist its state to db", task.getUuid()), e); + String errorMessage = format("Failed to finalize task with uuid '%s' and persist its state to db", task.getUuid()); + if (error instanceof MessageException) { + LOG.error(format("%s. Task failed with MessageException \"%s\"", errorMessage, error.getMessage()), e); + } else { + LOG.error(errorMessage, e); + } } finally { stopActivityProfiler(ceProfiler, task, status); ceLogging.clearForTask(); |