Coder Social home page Coder Social logo

exception_notification-rake's Introduction

exception_notification-rake - ExceptionNotifier for Rake tasks

This Ruby gem is an extension of the exception_notification gem to support sending mail (or other sorts of notifications) upon failures in Rake tasks. This is useful if you run Rake tasks as batch jobs on a schedule, particularly if you're using the Heroku Scheduler add-on.

Build Status

Installation

If you're using Rails 4.2, 5 or 6 (or you're not using Rails at all), use the latest version of the gem:

gem 'exception_notification-rake', '~> 0.3.1'

If you're using Rails 4.1.x, use the 0.2.x line of versions:

gem 'exception_notification-rake', '~> 0.2.2'

If you're using Rails 4.0.x, use the 0.1.x line of versions:

gem 'exception_notification-rake', '~> 0.1.3'

If you're using Rails 3, use the 0.0.x line of versions:

gem 'exception_notification-rake', '~> 0.0.7'

Usage

Configuration for Email Notifications

Note: These examples are for the latest version of the gem (using exception_notification 4+ and Rails 4+). For a Rails 3.2 example see below.

Exception notification must be set up in your Rails config files. In general, you'll want to do this in environment-specific config files, such as config/environments/production.rb. Minimal configuration:

# config/environments/production.rb

YourApp::Application.configure do
  # Other configuration here, including ActionMailer config ...

  config.middleware.use ExceptionNotification::Rack,
    :ignore_if => lambda { |env, exception| !env.nil? },
    :email => {
      :sender_address => %{"notifier" <[email protected]>},
      :exception_recipients => %w{[email protected]}
    }

  ExceptionNotifier::Rake.configure
end

Note: This uses :ignore_if to suppress all exception notifications not triggered by a background exception (identified by a nil environment). If you want to see all notifications (i.e., also those triggered by requests to the Rails server), omit the :ignore_if option.

If you are already using ExceptionNotifier anyway, you don't need to configure it again and all you need is:

# config/environments/production.rb

YourApp::Application.configure do
  # Other configuration here, including ExceptionNotifer and ActionMailer config ...

  ExceptionNotifier::Rake.configure
end

Note: As a prerequisite for sending mail your Rails Action Mailer needs to be configured in the environment where you're using exception notification. See the Rails guide on Action Mailer.

Other Notifiers

exception_notificatons supports a bunch of notifiers other than email. See its documentation for details. This gem should generally work out of the box with all notifiers. The Rake command line that led to the failure is available at the :rake_command_line key in the data dictionary.

Rails 3.2 Configuration Example

# config/environments/production.rb

YourApp::Application.configure do
  # Other configuration here, including ActionMailer config ...

  config.middleware.use ExceptionNotifier,
    :sender_address       => %{"notifier" <[email protected]>},
    :exception_recipients => %w{[email protected]},
    :ignore_if            => lambda { true }

  ExceptionNotifier::Rake.configure
end

For complete documentation on the Rails 3.2 version see the corresponding branch on GitHub.

Email Notification Example

Email sent upon a failure will include the Rake tasks executed and a stacktrace. This is the result from calling an undefined method khaaaaan! in a task called failing_task (the data section contains the executed Rake command line in the :rake_command_line key):

Subject: [ERROR] (NoMethodError) "undefined method `khaaaaan!' for main:Object"
From: "notifier" <[email protected]>
To: <[email protected]>

A NoMethodError occurred in background at 2014-07-20 21:25:00 UTC :

  undefined method `khaaaaan!' for main:Object
  /Users/haldimann/Projects/nikhaldimann.com/lib/tasks/scheduler.rake:33:in `block in <top (required)>'

-------------------------------
Backtrace:
-------------------------------

  lib/tasks/scheduler.rake:33:in `block in <top (required)>'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
  .rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
  .rvm/gems/ruby-1.9.3-p327/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
  .rvm/gems/ruby-1.9.3-p327/bin/rake:19:in `load'
  .rvm/gems/ruby-1.9.3-p327/bin/rake:19:in `<main>'
  .rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
  .rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'

-------------------------------
Data:
-------------------------------

  * data: {:rake_command_line=>"rake failing_task"}

Usage with Heroku Scheduler

If you're using Heroku, the Scheduler add-on is a very convenient and cheap way to run scheduled batch jobs. In a Rails environment it's easiest to define batch jobs as Rake tasks. However, the only way to find out whether a task run by the scheduler succeeded or failed is generally reading the logs.

This gem fixes this issue. Here is a detailed guide about configuring it on Heroku. In summary: If you configure exception notification as described above it should work out of the box with the Heroku Scheduler. (Provided you have email delivery set up in your Heroku app - you could try the SendGrid add-on which comes in a free version that should be good enough for notifications.)

Customization

You can pass configuration options to ExceptionNotifier::Rake.configure. These will be passed through to each notifier you configured with ExceptionNotifier (see its documentation for details on options). The options will be applied only to notifications sent as a result of Rake failures.

The most likely options you'll want to use are :email_prefix and :exception_recipients. Example:

ExceptionNotifier::Rake.configure(
  :email => {
    :email_prefix => "[Rake Failure] ",
    :exception_recipients => %w{[email protected] [email protected]}})

This will prefix the email subjects of Rake failure notifications with [Rake Failure] and will send them to the two given email addresses. Note that if you set the same options when you configure ExceptionNotifier mail notifier itself, they will be overridden but for Rake failures only.

:ignore_if and :ignore_exceptions are also supported. But note that the :ignore_if block will be evaluated for all exceptions, not just the ones triggered by Rake (this is unavoidable because of the design of exception_notification). The first argument to the block passed to :ignore_if is the environment - for all Rake failures and other background exceptions this will be nil, giving you some way to distinguish them.

License

Distributed under an MIT license.

exception_notification-rake's People

Contributors

deeeki avatar derwiki avatar lostapathy avatar nikhaldi avatar stringsn88keys avatar tylerrick avatar wjgilmore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

exception_notification-rake's Issues

Remove 'git ls-files' from gemspec

I just got bit by this.

Our prod environment doesn't have git and if you try adding a gem through git or path option in bundler, 'git ls-files' in the .gemspec fails.

similar issue

Wondering if it is better to specify files rather than count on git being installed. Thoughts?

--- a/exception_notification-rake.gemspec
+++ b/exception_notification-rake.gemspec
@@ -17,8 +17,7 @@ Gem::Specification.new do |s|
   s.add_runtime_dependency 'rake', '>= 0.9.0'
   s.add_development_dependency 'rails', '~> 3.2.0'

-  s.files         = `git ls-files`.split("\n")
-  s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
-  s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+  s.files         = Dir['LICENSE.md', 'README.md', 'lib/**/*']
+  s.test_files    = Dir['test/**/*.rb']
   s.require_paths = ['lib']
 end

Not working with custom notifiers

Hi, nikhaldi

I wrote a custom email notifier:

module ExceptionNotifier
  class DynamicEmailNotifier < EmailNotifier
    def call(exception, options={})
      options.reverse_merge!(exception_recipients: Admin.where(notified: true).pluck(:email))
      super
    end
  end
end

and added the following configuration to config/environments/<env>:

Rails.application.configure do
  # ...
  config.middleware.use ExceptionNotification::Rack,
    dynamic_email: {
        email_prefix: '[EDM2] ',
        sender_address: 'Admin <[email protected]>',
        # Override default action mailer settings.
        delivery_method: :smtp,
        smtp_settings: {
            address: '127.0.0.1',
            port: 25,
            user_name: '[email protected]',
            password: Rails.application.secrets[:sender_password],
            authentication: :plain,
            enable_starttls_auto: true,
            openssl_verify_mode: 'none'
        }
    }
  ExceptionNotifier::Rake.configure
end

It works well when the exceptions are triggered by the HTTP requests, but when the exceptions are from rake tasks, no email is sent, and there is no record in maillog indicating that any email delivery has been tried.

Doesn't work with spring

Steps to reproduce

  1. Check out a Rails app that has spring inserted in the binstubs โ€” for example, this example app:
    https://github.com/TylerRick/exception_notification-rake_example_with_spring/tree/workaround_using_load_in_bin_rake

  2. Run bin/rake check:exception

  3. Observe that no email is sent

How it's supposed to work

Normally (without spring), what happens is:

  • the bin/rake binstub gets loaded first, and
  • that is what triggers rake.rb and rake/rake_module.rb (which defines Rake.application) to get loaded.
  • Then Bundler.require loads exception_notification-rake gem, which checks that Rake.application is defined and patches Rake::Application#display_error_message

This is evident from the following backtraces taken at those 2 points:

"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:2:in `<top (required)>'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake.rb:44:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake.rb:44:in `<top (required)>'",
  require "rake/rake_module"
"bin/rake:8:in `require'",
"bin/rake:8:in `<main>'"]
  require 'rake'

(or if using global rake instead of bin/rake binstub:

"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:4:in `<top (required)>'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake.rb:44:in `<top (required)>'",
  require "rake/rake_module"
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake:25:in `<top (required)>'",
"~/.gem/ruby/2.6.0/bin/rake:23:in `load'",
"~/.gem/ruby/2.6.0/bin/rake:23:in `<main>'"]
  load Gem.activate_bin_path('rake', 'rake', version)

)

"exception_notification-rake/lib/exception_notifier/rake/rake_patch.rb:5:in `<top (required)>'",
"exception_notification-rake/lib/exception_notifier/rake.rb:2:in `require'",
"exception_notification-rake/lib/exception_notifier/rake.rb:2:in `<top (required)>'",
"exception_notification-rake/lib/exception_notification/rake.rb:3:in `require'",
"exception_notification-rake/lib/exception_notification/rake.rb:3:in `<top (required)>'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:95:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:95:in `rescue in block in require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:72:in `block in require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:114:in `require'",
"example_app/config/application.rb:7:in `<top (required)>'",
  Bundler.require(*Rails.groups)
"example_app/Rakefile:4:in `require_relative'",
"example_app/Rakefile:4:in `<top (required)>'",
  require_relative 'config/application'
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:31:in `load'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:31:in `load_rakefile'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:703:in `raw_load_rakefile'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:104:in `block in load_rakefile'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:103:in `load_rakefile'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:82:in `block in run'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'",
"bin/rake:10:in `<main>'"]

How it works instead when using spring

But when using spring:

  • spring's preload loads exception_notifier-rake gem before bin/rake is loaded
  • exception_notification-rake checks if Rake.application is defined; since it is not, it doesn't patch Rake::Application#display_error_message and so this gem has no effect
  • Then the bin/rake binstub gets loaded,
  • which triggers rake.rb and rake/rake_module.rb (which defines Rake.application) to get loaded (too late).

Again, you can see this from the backtraces if you wish:

"exception_notification-rake/lib/exception_notifier/rake/rake_patch.rb:5:in `<top (required)>'",
"exception_notification-rake/lib/exception_notifier/rake.rb:2:in `require'",
"exception_notification-rake/lib/exception_notifier/rake.rb:2:in `<top (required)>'",
"exception_notification-rake/lib/exception_notification/rake.rb:3:in `require'",
"exception_notification-rake/lib/exception_notification/rake.rb:3:in `<top (required)>'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:95:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:95:in `rescue in block in require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:72:in `block in require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require'",
"~/.rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler.rb:114:in `require'",
"example_app/config/application.rb:7:in `<top (required)>'",
  Bundler.require(*Rails.groups)
"ruby/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'",
"ruby/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/rake_module.rb:2:in `<top (required)>'",
"~/.rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake.rb:44:in `<top (required)>'",
"example_app/bin/rake:8:in `<top (required)>'",
  require 'rake'
"~/.gem/ruby/2.6.0/gems/spring-2.0.2/lib/spring/command_wrapper.rb:40:in `call'",
"~/.gem/ruby/2.6.0/gems/spring-2.0.2/lib/spring/application.rb:201:in `block in serve'",

Workaround

One workaround is to add this line to bin/rake:

 require 'rake'
+load 'exception_notifier/rake/rake_patch.rb'
 Rake.application.run

But a better solution is needed that doesn't require modifying the binstubs that spring automatically generated...

Undefined method "application" for Rake:Module

I just started receiving this error recently - most likely after my recent rails version update.

  • Ruby Version: 2.3.1
  • Rails Version: 4.2.6
  Message from application: undefined method `application' for Rake:Module (NoMethodError)
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/exception_notification-rake-0.2.1/lib/exception_notifier/rake/rake_patch.rb:27:in `<top (required)>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/exception_notification-rake-0.2.1/lib/exception_notifier/rake.rb:2:in `<top (required)>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@www/gems/exception_notification-rake-0.2.1/lib/exception_notification/rake.rb:3:in `<top (required)>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `rescue in block in require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:77:in `block in require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
  /home/vagrant/apps/www-staging/config/application.rb:7:in `<top (required)>'
  /home/vagrant/apps/www-staging/config/environment.rb:2:in `require'
  /home/vagrant/apps/www-staging/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:110:in `eval'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:110:in `preload_app'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /home/vagrant/.rvm/gems/ruby-2.3.1@global/gems/passenger-5.0.28/src/helper-scripts/rack-preloader.rb:29:in `<main>'

Not working with resque-retry

I installed now resque-retry and my exceptions are not sent anymore by mail...
I can just see them under the failed tab in the resque-web.. but no exception mails anymore :(

Any suggestions?

Thanks for your great work!

ignore, ignore_if should work as configuration options

Because of the way exception_notification-rake calls the notifier.deliver method directly, the options for ignore and ignore_if never take effect if specified in the en-rake config block. It would be nice if this could be fixed.

Rails 4.1 and exception_notification-rake gem causing uninitialized constant ExceptionNotification

Hello, I'm not 100% sure this is a bug in exception_notification-rake but I have a feeling it might be, so I'll post the issue I'm having here: http://stackoverflow.com/questions/22959711/rails-4-1-and-exception-notification-rake-gem-causing-uninitialized-constant-exc

I get an uninitialized constant ExceptionNotification (NameError) when trying to start up the Rails server after an upgrade to Rails 4.1

Cheers!

Rails 5 support

Currently, this gem only supports Rails ~> 4.1.0 and it would be great if it worked with Rails 5 as well.

fails when :normalize_subject => true

When the :normalize_subject options is set to true, exception_notification-rake fails with the following error:

NoMethodError: undefined method `normalize_digits' for #ExceptionNotifier::Notifier:0x007f8003f47a88

It's failing on line 125 of lib/exception_notifier/notifier.rb

subject = normalize_digits(subject) if @options[:normalize_subject]

Where :normalize_digits is a method of self.class, not self.

No longer maintained?

Hi! Is this project still maintained? I see there are PRs from 2016 that are still unresolved.

image

Not working with Rubymine 11 Testing

Object.const_defined? :Rake returns true in Rubymine RSpec tests even if Rake isn't running causing rake_patch.rb to fail.

Not sure whether to file this here or on the Rubymine project.

rails: use runner API to handle exceptions in Rails runner

See airbrake/airbrake#377 / airbrake/airbrake#585

I use a lot of Rails runners instead of rake tasks for cron jobs these days. (Seems silly to have to add a new rake task for every new command, when all the rake task does is call a one-liner like SomeClass.send_reminders.)

But I was somewhat surprised to learn that these runner commands were failing and I wasn't getting any notifications. This is very bad!

I think most exception_notification Rails users would like to automatically be notified of errors occurring in their application generally, including background jobs, like what Airblade gives us (see railtie.rb), except using exception_notification ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.