Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.wrap(model, options = {})
].join('::')

view_model_class.constantize.new(model, options)
rescue
rescue NameError
new(model, options)
end

Expand Down
2 changes: 1 addition & 1 deletion core/app/models/workarea/data_file/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def process!
Workarea::Release.with_current(release_id) do
run_callbacks(:process) { format.import! }
end
rescue Exception => e
rescue StandardError => e
self.error_type = e.class
self.error_message = e.message
raise e
Expand Down
2 changes: 1 addition & 1 deletion core/app/models/workarea/payment/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def success?
def complete!
begin
complete_each_transaction!
rescue Exception => e
rescue StandardError => e
rollback!
raise e
ensure
Expand Down
2 changes: 1 addition & 1 deletion core/app/models/workarea/payment/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.update_email(reference, new_email)
#
def default_credit_card
credit_cards.find_by(default: true)
rescue
rescue Mongoid::Errors::DocumentNotFound
credit_cards.desc(:created_at).first
end

Expand Down
2 changes: 1 addition & 1 deletion core/app/models/workarea/payment/tender/credit_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tokenized?

def saved_card
@saved_card ||= profile.credit_cards.find(saved_card_id) if saved?
rescue
rescue Mongoid::Errors::DocumentNotFound
nil
end

Expand Down
13 changes: 10 additions & 3 deletions core/app/models/workarea/product_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ def field
# @return [Comparable]
#
def value
return Time.zone.parse(value_field) rescue value_field if created_at?
value_field
if created_at?
begin
Time.zone.parse(value_field)
rescue ArgumentError, TypeError
value_field
end
else
value_field
end
end

# This is HACK for the fact that we want a CSV string in value, but our
Expand Down Expand Up @@ -134,7 +141,7 @@ def value_is_date_if_field_is_date
if created_at?
begin
Time.zone.parse(value_field)
rescue
rescue ArgumentError, TypeError
errors.add(
:base,
I18n.t('workarea.errors.messages.not_a_date')
Expand Down
2 changes: 1 addition & 1 deletion core/app/services/workarea/direct_upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def delete!
def processor
return @processor if defined?(@processor)
@processor = "Workarea::DirectUpload::#{@type.camelize}".constantize.new(self)
rescue
rescue NameError
@processor = nil
end

Expand Down
2 changes: 1 addition & 1 deletion core/app/workers/workarea/index_category_changes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def perform(changes, for_release = false)
Catalog::Product.in(id: ids).each do |product|
begin
IndexProduct.perform(product)
rescue
rescue StandardError
IndexProduct.perform_async(product.id)
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/lib/workarea/latest_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.get

JSON.parse(response.body)['version']
end
rescue Exception => e
rescue StandardError => e
Workarea::ErrorReporting.report(
e,
handled: true,
Expand Down
2 changes: 1 addition & 1 deletion core/lib/workarea/monitoring/mongoid_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def database_up?
.collections
.find
.present?
rescue
rescue StandardError
false
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/lib/workarea/monitoring/sidekiq_queue_size_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def check

[status, "#{status ? 'Low' : 'High'} - #{length}"]

rescue
rescue StandardError
[false, 'Down']
end
end
Expand Down
4 changes: 2 additions & 2 deletions core/lib/workarea/ping_home_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def ping
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start { |h| h.request(request) }

rescue Exception => e
rescue StandardError => e
Workarea::ErrorReporting.report(
e,
handled: true,
Expand Down Expand Up @@ -61,7 +61,7 @@ def client_id
return unless File.exist?(Rails.root.join('.client-id'))

File.read(Rails.root.join('.client-id'))
rescue
rescue StandardError
nil
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def retrieve_merchant_details(options = {})
parse_merchant_details_response(response)
rescue ActiveUtils::ResponseError, ActiveShipping::ResponseError => e
error_response(e.response.body, CPPWSMerchantDetailsResponse)
rescue Exception => e
rescue StandardError => e
raise ResponseError.new(e.message)
end

Expand Down
Loading