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

Rails 7 API only exception not working #530

Open
nengine opened this issue Mar 9, 2022 · 3 comments
Open

Rails 7 API only exception not working #530

nengine opened this issue Mar 9, 2022 · 3 comments

Comments

@nengine
Copy link

nengine commented Mar 9, 2022

Steps to reproduce

rails g exception_notification:install --sidekiq

config/initializers/exception_notification.rb

config.add_notifier :email, {
email_prefix: '[ERROR] ',
sender_address: %{"Rails API Exception" [email protected]},
exception_recipients: %w{[email protected]}
}

:smtp email configured and working properly with sidekiq.

Expected behavior

ActiveRecord::RecordNotFound was raised and expected to get email notification.

Actual behavior

Nothing happens. No exception email received.

System configuration

Rails version:
7.0.1
Ruby version:
3.1
Other configurations:
SMTP email with sidekiq

@backwardm
Copy link

I am seeing the same issue under rails 7.0.2.2 and ruby 3.0.2. Sidekiq is able to send email but emails are not being sent via the gem. @nengine, did you figure out what was happening by chance?

@werebus
Copy link

werebus commented May 3, 2023

Worth mentioning that ActiveRecord::RecordNotFound is in the default list of ignored exceptions. If you want notifications of that particular exception, you'll need to redefine that list.

@prsanjay
Copy link

prsanjay commented Jul 6, 2023

I also have API only rails 6 and it does not send notification automatically but If I use ExceptionNotifier.notify_exception(e) then it works. In my case its 500 internal server error from rails app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants