lib/airbrake.rb in airbrake-3.1.16 vs lib/airbrake.rb in airbrake-3.1.17

- old
+ new

@@ -59,10 +59,16 @@ # Prints out the details about the notice that wasn't sent to server def report_notice(notice) write_verbose_log("Notice details: \n#{notice}") end + def report_notice_not_sent_for_configuration + write_verbose_log("Notice was not sent due to configuration: \ + \n Environment Monitored? #{configuration.public?} \ + \n API key set? #{configuration.configured?}") + end + # Returns the Ruby version, Rails version, and current Rails environment def environment_info info = "[Ruby: #{RUBY_VERSION}]" info << " [#{configuration.framework}]" if configuration.framework info << " [Env: #{configuration.environment_name}]" if configuration.environment_name @@ -145,16 +151,18 @@ end private def send_notice(notice) - if configuration.public? + if configuration.configured? && configuration.public? if configuration.async? configuration.async.call(notice) nil # make sure we never set env["airbrake.error_id"] for async notices else sender.send_to_airbrake(notice) end + else + report_notice_not_sent_for_configuration end end def build_notice_for(exception, opts = {}) exception = unwrap_exception(exception)