module SlackNotifierWrapper::Helpers

Public Instance Methods

execute_or_speak(method_name) click to toggle source
# File lib/slack_notifier_wrapper/helpers.rb, line 4
def execute_or_speak(method_name)
  begin
    send(method_name)
  rescue Exception => e
    attachment_message = "#{self.class}##{method_name} failed to execute: #{e.message}"
    SlackNotifierWrapper.speak_attachments({ color: "danger", attachment_message: attachment_message })
    raise e
  end
end