Skip to content

Instantly share code, notes, and snippets.

@bionicpill
Created May 23, 2014 20:53
Show Gist options
  • Save bionicpill/de034d158b5cfac4b8f2 to your computer and use it in GitHub Desktop.
Save bionicpill/de034d158b5cfac4b8f2 to your computer and use it in GitHub Desktop.
diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb
index caf2156..71afd75 100644
--- a/app/mailers/admin_mailer.rb
+++ b/app/mailers/admin_mailer.rb
@@ -10,10 +10,10 @@ class AdminMailer < BaseMailer
subject: "[TP] WE GOT ONE: #{@organization.name}"
end
- def logo_resize_failed(file_name, organization_id, exception)
+ def logo_resize_failed(file_name, organization_id, exception_info)
@file_name = file_name
@organization_id = organization_id
- @exception = exception
+ @exception_info = exception_info
mail to: Tp::Config.mailer.developers,
from: Tp::Config.mailer.from_email,
diff --git a/app/views/admin_mailer/logo_resize_failed.html.haml b/app/views/admin_mailer/logo_resize_failed.html.haml
index b7c2a54..b89e908 100644
--- a/app/views/admin_mailer/logo_resize_failed.html.haml
+++ b/app/views/admin_mailer/logo_resize_failed.html.haml
@@ -11,7 +11,7 @@
Exception
%pre
- = @exception.message
+ = @exception.fetch(:message)
%pre
- = @exception.backtrace
+ = @exception.fetch(:backtrace)
diff --git a/app/workers/create_logo_worker.rb b/app/workers/create_logo_worker.rb
index c4d09bb..9dcbd0f 100644
--- a/app/workers/create_logo_worker.rb
+++ b/app/workers/create_logo_worker.rb
@@ -5,8 +5,10 @@ class CreateLogoWorker < BaseWorker
Tp::OrganizationLogo.resize_and_save(file_name, organization_id)
rescue StandardError => exception
+ exception_info = { message: exception.message,
+ backtrace: exception.backtrace }
AdminMailer.
- logo_resize_failed(file_name, organization_id, exception).
+ logo_resize_failed(file_name, organization_id, exception_info).
deliver
raise exception
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment