Commit c553ad104fd36571b3725ba6206bccfd653833a3
1 parent
72d8ae0c
Exists in
master
and in
29 other branches
Remove catch-all rescue clause
It was masking a programming error, which is now fixed.
Showing
5 changed files
with
9 additions
and
5 deletions
Show diff stats
plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb
... | ... | @@ -114,7 +114,7 @@ class ShoppingCartPluginController < PublicController |
114 | 114 | :message => _('Request sent successfully. Check your email.'), |
115 | 115 | :error => {:code => 0} |
116 | 116 | }.to_json |
117 | - rescue Exception => exception | |
117 | + rescue ActiveRecord::ActiveRecordError | |
118 | 118 | render :text => { |
119 | 119 | :ok => false, |
120 | 120 | :error => { | ... | ... |
plugins/shopping_cart/lib/shopping_cart_plugin/cart_helper.rb
plugins/shopping_cart/lib/shopping_cart_plugin/mailer.rb
... | ... | @@ -12,7 +12,8 @@ class ShoppingCartPlugin::Mailer < Noosfero::Plugin::MailerBase |
12 | 12 | body :customer => customer, |
13 | 13 | :supplier => supplier, |
14 | 14 | :items => items, |
15 | - :environment => supplier.environment | |
15 | + :environment => supplier.environment, | |
16 | + :helper => self | |
16 | 17 | end |
17 | 18 | |
18 | 19 | def supplier_notification(customer, supplier, items) |
... | ... | @@ -25,6 +26,8 @@ class ShoppingCartPlugin::Mailer < Noosfero::Plugin::MailerBase |
25 | 26 | body :customer => customer, |
26 | 27 | :supplier => supplier, |
27 | 28 | :items => items, |
28 | - :environment => supplier.environment | |
29 | + :environment => supplier.environment, | |
30 | + :helper => self | |
31 | + | |
29 | 32 | end |
30 | 33 | end | ... | ... |
plugins/shopping_cart/views/shopping_cart_plugin/mailer/customer_notification.html.erb
plugins/shopping_cart/views/shopping_cart_plugin/mailer/supplier_notification.html.erb