Skip to content

Google Chat is not sending error notification #531

@charly-palencia

Description

@charly-palencia

ExceptionNotification has been working OK with the email configuration, but I recently added the 'google chat' parameter to receive my error in the Google space chat. I tested it in console, and it worked ok, but when I tried it with the rails' app, no message was sent, yet the email functioned normally. Thank you for your assistance as well as this wonderful find!

Steps to reproduce

Set configuration

Site::Application.config.middleware.use ExceptionNotification::Rack,
	ignore_exceptions: ['Mime::Type::InvalidMimeType'] + ExceptionNotifier.ignored_exceptions,
    # Don't send google chat notifications in test & development environments
	ignore_notifier_if: {
	    google_chat: ->(env, exception) { Rails.env.development? || Rails.env.test? }
    },
	:email => {
		  :email_prefix => "[EXCEPTION] ",
		  :sender_address => %{"app email" <noreply@test.com>},
		  :exception_recipients => %w{system_messages@test.com}
	},
    :google_chat => {
      webhook_url: Rails.application.credentials[:google_chat_webhook_url],
      app_name: Rails.env.titlecase
    },
	error_grouping: true

Expected behavior

  • Send email notification
  • Send google chat notification

Actual behavior

  • Send email notification

Note

Using the manual testing process in the rails console the application is sending both notification (email and google chat)

ExceptionNotifier.notify_exception(StandardError.new  )

System configuration

Rails version: 6.0.3.7

Ruby version: 2.7.1p83

Other configurations:
current gem version: "4.5.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions