diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-12-23 22:36:03 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-12-23 22:36:03 +0100 |
commit | 5e87ef770b0195d7abfbcf071232940ae14588b5 (patch) | |
tree | ac2bf56f28eaba4538792c8a40cb59cd91c752e8 /sonar-server/src/main/webapp/WEB-INF | |
parent | 5e34fbd623c274fbed43151ef3fb561ae92c99ca (diff) | |
download | sonarqube-5e87ef770b0195d7abfbcf071232940ae14588b5.tar.gz sonarqube-5e87ef770b0195d7abfbcf071232940ae14588b5.zip |
SONAR-4535 Add some check when creating new rule
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index 64bcc347291..4c7e8018e36 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -228,9 +228,12 @@ class ApplicationController < ActionController::Base end def java_error_message(exception) - message = (exception.getMessage ? exception.getMessage : Api::Utils.message(exception.l10nKey, :params => exception.l10nParams.to_a)) - if exception.java_kind_of?(Java::OrgSonarServerExceptions::BadRequestException) && !exception.errors.empty? - message += '<br/>' + exception.errors.to_a.map{|error| error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)}.join('<br/>') + 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.empty? + message += '<br/>' unless message.blank? or !has_errors + if has_errors + message += exception.errors.to_a.map{|error| error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)}.join('<br/>') end message end |