lib/sidekiq/logging/shared.rb in sidekiq-logstash-2.0.0 vs lib/sidekiq/logging/shared.rb in sidekiq-logstash-2.0.1
- old
+ new
@@ -47,10 +47,12 @@
payload = setup_payload(job)
payload['duration'] = elapsed(started_at)
payload['message'] += ": fail: #{payload['duration']} sec"
payload['job_status'] = 'fail'
+
+ exc = exc.cause || exc if exc.is_a? Sidekiq::JobRetry::Handled
payload['error_message'] = exc.message
payload['error'] = exc.class
payload['error_backtrace'] = %('#{exc.backtrace.join("\n")}')
process_payload(payload)
@@ -126,10 +128,10 @@
end
def deep_stringify!(args)
case args
when Hash
- Hash[args.map { |key, value| [deep_stringify!(key), deep_stringify!(value)] }]
+ args.map { |key, value| [deep_stringify!(key), deep_stringify!(value)] }.to_h
when Array
args.map! { |val| deep_stringify!(val) }
else
args.to_s
end