Skip to content

Instantly share code, notes, and snippets.

@cheeyeo
Created August 19, 2015 22:28
Show Gist options
  • Save cheeyeo/c82cdb7fa055d7a32fe5 to your computer and use it in GitHub Desktop.
Save cheeyeo/c82cdb7fa055d7a32fe5 to your computer and use it in GitHub Desktop.
error handling
begin
update_purchase_captured_at!(purchase, captured_at)
rescue Exception => e
Honeybadger.notify(e)
Rails.logger.error(%Q{\
[#{Time.zone.now}][rake purchases:update_captured_at] Error updating \
captured_at for purchase #{purchase.id}: #{e.class}: #{e.message}
This means the funds got captured, but the order will *not* be fulfilled!
Visit http://thepaymentprocess.com/admin and search for transaction ID
#{purchase.transaction_id} for more details on this purchase.
#{e.backtrace}})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment