Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack notification won't work #291

Closed
poc7667 opened this issue Oct 22, 2015 · 2 comments
Closed

Slack notification won't work #291

poc7667 opened this issue Oct 22, 2015 · 2 comments
Labels
bug existing issue

Comments

@poc7667
Copy link

poc7667 commented Oct 22, 2015

Slack notification won't work

  • exception_notification (4.1.1)
  • slack-notifier (1.2.1)

run this function in Rails console to test notification

  def a1
    begin
      1/0
    rescue Exception => e
        e=Exception.new
        ExceptionNotifier.notify_exception(e,:env => "development", :data => {:message => e})    
    end
  end

Exception messages

  W, [2015-10-22T14:54:16.851040 #53346]  WARN -- : An error occurred when sending a notification using 'slack' notifier. NoMethodError: undefined method `first' for nil:NilClass
  /Users/sample1/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/exception_notification-4.1.1/lib/exception_notifier/slack_notifier.rb:20:in `call'
  /Users/sample1/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/exception_notification-4.1.1/lib/exception_notifier.rb:94:in `fire_notification'
  /Users/sample1/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/exception_notification-4.1.1/lib/exception_notifier.rb:39:in `block in notify_exception'
  /Users/sample1/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/exception_notification-4.1.1/lib/exception_notifier.rb:38:in `each'
  /Users/sample1/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/exception_notification-4.1.1/lib/exception_notifier.rb:38:in `notify_exception'

initializers

Rails.application.config.middleware.use ExceptionNotification::Rack,
:slack => {
  :webhook_url => "https://hooks.slack.com/services/Txxx",
  :channel => "#exceptions",
  :additional_parameters => {
    :icon_url => "http://image.jpg",
    :mrkdwn => true
  }
}
@rodrigopdl
Copy link

This problem has been fixed as of version 4.1.2. Upgrading exception-notification to a newer version should be enough.

@san650
Copy link

san650 commented Mar 13, 2016

Thanks @rodrigopdl for checking! Closing this issue.

@poc7667 please reopen the issue if you still face any problem.

@san650 san650 closed this as completed Mar 13, 2016
@san650 san650 added the bug existing issue label Mar 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug existing issue
Projects
None yet
Development

No branches or pull requests

3 participants