lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.72920 vs lib/bbk/app/dispatcher.rb in bbk-app-1.0.0.78020
- old
+ new
@@ -123,10 +123,11 @@
e.is_a? BBK::App::Dispatcher::Result
end
logger.debug "There are #{results.count} results to send from #{message.headers[:message_id]}..."
send_results(message, results).value
rescue StandardError => e
+ logger.error "Failed processing message: #{e.inspect}"
ActiveSupport::Notifications.instrument 'dispatcher.exception', msg: message, exception: e
message.nack(error: e)
close if force_quit
end
@@ -137,9 +138,10 @@
is_unknown = @observer.instance_variable_get('@default') == processor
ActiveSupport::Notifications.instrument 'dispatcher.request.process', msg: message, match: matched, unknown: is_unknown do
processor.call(message, results: results)
end
rescue StandardError => e
+ logger.error "Failed processing message in processor: #{e.inspect}"
if processor.respond_to?(:on_error)
results = processor.on_error(message, e)
else
raise
end