ExceptionNotification: Fix DNS lookup before plugins call external APIs

Updated . Posted . Visible to the public.

The ExceptionNotification has plugins that talk to external APIs rather then just sends emails, like microsoft teams or slack. You might encounter that no exceptions are delivered, which can be dangerous.

To prevent getting into trouble, simply add require 'resolv-replace' on top of your to your initializers/exception_notification.rb file:

require 'resolv-replace'
require 'exception_notification/rails'

ExceptionNotification.configure do |config|
  ...
end

This calls the Ruby DNS resolver before configuring ExceptionNotifier so the DNS lookup always works as expected.

Jakob Scholz
Last edit
Jakob Scholz
License
Source code in this card is licensed under the MIT License.
Posted by Jakob Scholz to makandra dev (2021-01-08 07:45)