-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
I'm not sure how the community feels about this but I would be willing to work on this myself if there is enough interest. Currently many of the Solidus errors are logged like so:
Rails.logger.error(<String>)
# Or
Rails.logger.error(e.message)This is fine in a lot of cases, however in certain cases this is not optimal. The reason I say it isn't optimal is because stack trace is eliminated making it harder to debug. When using reporting services such as Rollbar it is nice to have those stack traces.
Non-Optimal Examples
Better Example
Summary
When ever we rescue an error we should call Rails.logger.error(error) or Rails.logger.warn(error). Here are some examples where this practice could be implemented.
solidus/frontend/app/controllers/spree/store_controller.rb
Lines 25 to 28 in 4857815
| rescue Spree::OrderMutex::LockFailed | |
| flash[:error] = t('spree.order_mutex_error') | |
| redirect_to spree.cart_path | |
| end |
solidus/backend/app/controllers/spree/admin/payments_controller.rb
Lines 49 to 52 in 859143f
| rescue Spree::Core::GatewayError => e | |
| flash[:error] = e.message.to_s | |
| redirect_to new_admin_order_payment_path(@order) | |
| end |
solidus/backend/app/controllers/spree/admin/payments_controller.rb
Lines 49 to 52 in 859143f
| rescue Spree::Core::GatewayError => e | |
| flash[:error] = e.message.to_s | |
| redirect_to new_admin_order_payment_path(@order) | |
| end |
Again this is nothing major but more of a quality of life change.



