lib/webhook_system/job.rb in webhook_system-2.1.3 vs lib/webhook_system/job.rb in webhook_system-2.1.4

- old
+ new

@@ -44,16 +44,15 @@ rescue RuntimeError => exception ErrorResponse.new(exception) end log_response(subscription, event, request, response) - ensure_success(response) + ensure_success(response.status, :POST, subscription.url) end - def self.ensure_success(response) - status = response.status + def self.ensure_success(status, http_method, url) unless (200..299).cover? status - raise RequestFailed.new("request failed with code: #{status}", status) + raise RequestFailed.new("#{http_method} request to #{url} failed with code: #{status}", status) end end def self.build_request(client, subscription, event) payload, headers = Encoder.encode(subscription.secret, event, format: format_for_subscription(subscription))