From 2d77050b049a1c51eef40af8a51fa82a4e16f782 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 17 Oct 2014 11:42:25 +0200 Subject: [PATCH] SONAR-5691 Exception messages are shown twice --- .../webapp/WEB-INF/app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5