From: Simon Brandhof Date: Fri, 17 Oct 2014 09:42:25 +0000 (+0200) Subject: SONAR-5691 Exception messages are shown twice X-Git-Tag: 4.5.1-RC1~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d77050b049a1c51eef40af8a51fa82a4e16f782;p=sonarqube.git SONAR-5691 Exception messages are shown twice --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index 7e07115ce41..b00d9d524d6 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -235,11 +235,11 @@ class ApplicationController < ActionController::Base def java_error_message(exception) message = '' - message += (exception.getMessage ? exception.getMessage : Api::Utils.message(exception.l10nKey, :params => exception.l10nParams.to_a)) if exception.getMessage or exception.l10nKey has_errors = exception.java_kind_of?(Java::OrgSonarServerExceptions::BadRequestException) && !exception.errors.isEmpty() - message += '
' unless message.blank? or !has_errors if has_errors message += exception.errors().messages().to_a.map{|msg| Api::Utils.message(msg.getKey(), :params => msg.getParams().to_a)}.join('
') + else + message += (exception.getMessage ? exception.getMessage : Api::Utils.message(exception.l10nKey, :params => exception.l10nParams.to_a)) if exception.getMessage || exception.l10nKey end message end