Commit 3307129f8eed7c235b282ee37004ca74345bae3c
Committed by
Paulo Meireles
1 parent
794a4d5a
Exists in
master
and in
29 other branches
[Mezuro] Draft to configuration exceptions handling.
Showing
9 changed files
with
24 additions
and
3 deletions
Show diff stats
plugins/mezuro/controllers/myprofile/mezuro_plugin_myprofile_controller.rb
@@ -3,8 +3,8 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | @@ -3,8 +3,8 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | ||
3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') | 3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
4 | 4 | ||
5 | rescue_from Exception do |exception| | 5 | rescue_from Exception do |exception| |
6 | - message = URI.escape(CGI.escape(exception.message),'.') | ||
7 | - redirect_to_error_page message | 6 | + @message = process_error_message exception.message |
7 | + render :partial => "error_page" | ||
8 | end | 8 | end |
9 | 9 | ||
10 | def error_page | 10 | def error_page |
@@ -26,7 +26,7 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | @@ -26,7 +26,7 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | ||
26 | protected | 26 | protected |
27 | 27 | ||
28 | def redirect_to_error_page(message) | 28 | def redirect_to_error_page(message) |
29 | - message = URI.escape(CGI.escape(message),'.') | 29 | + message = URI.escape(CGI.escape(process_error_message(message)),'.') |
30 | redirect_to "/myprofile/#{profile.identifier}/plugin/mezuro/error_page?message=#{message}" | 30 | redirect_to "/myprofile/#{profile.identifier}/plugin/mezuro/error_page?message=#{message}" |
31 | end | 31 | end |
32 | 32 | ||
@@ -34,4 +34,12 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | @@ -34,4 +34,12 @@ class MezuroPluginMyprofileController < ProfileController #MyprofileController? | ||
34 | not metric_configuration.errors.empty? | 34 | not metric_configuration.errors.empty? |
35 | end | 35 | end |
36 | 36 | ||
37 | + def process_error_message message | ||
38 | + if message =~ /bla/ | ||
39 | + message | ||
40 | + else | ||
41 | + message | ||
42 | + end | ||
43 | + end | ||
44 | + | ||
37 | end | 45 | end |
plugins/mezuro/views/mezuro_plugin_base_tool/_error_page.html.erb
0 → 100644
plugins/mezuro/views/mezuro_plugin_metric_configuration/_error_page.html.erb
0 → 100644
plugins/mezuro/views/mezuro_plugin_myprofile/_error_page.html.erb
0 → 100644
plugins/mezuro/views/mezuro_plugin_project/_error_page.html.erb
0 → 100644
plugins/mezuro/views/mezuro_plugin_range/_error_page.html.erb
0 → 100644
plugins/mezuro/views/mezuro_plugin_range/create_range.rjs
plugins/mezuro/views/mezuro_plugin_range/edit_range.rjs
1 | page.replace_html 'range_form', :partial => "edit_range", :locals => {:metric_name => @metric_name, :id => @configuration_content.id, :beginning_id => @beginning_id, :range => @range } | 1 | page.replace_html 'range_form', :partial => "edit_range", :locals => {:metric_name => @metric_name, :id => @configuration_content.id, :beginning_id => @beginning_id, :range => @range } |
2 | page.visual_effect :slide_down, "range_form" | 2 | page.visual_effect :slide_down, "range_form" |
3 | + |
plugins/mezuro/views/mezuro_plugin_range/new_range.rjs
1 | page.replace_html 'range_form', :partial => "new_range", :locals => {:metric_name => @metric_name, :id => @configuration_content.id } | 1 | page.replace_html 'range_form', :partial => "new_range", :locals => {:metric_name => @metric_name, :id => @configuration_content.id } |
2 | page.visual_effect :slide_down, "range_form" | 2 | page.visual_effect :slide_down, "range_form" |
3 | + |