Skip to content

Commit

Permalink
feat: change error logs to info logs
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Feb 9, 2019
1 parent b28359f commit 700f699
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/api/resources/base_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def invalid_json?
JSON.parse(request_body, PACT_PARSING_OPTIONS) #Not load! Otherwise it will try to load Ruby classes.
false
rescue StandardError => e
logger.error "Error parsing JSON #{e} - #{request_body}"
logger.info "Error parsing JSON #{e} - #{request_body}"
set_json_error_message "Error parsing JSON - #{e.message}"
response.headers['Content-Type'] = 'application/hal+json;charset=utf-8'
true
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/webhooks/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def handle_failure
reschedule_job
update_triggered_webhook_status TriggeredWebhook::STATUS_RETRYING
else
logger.error "Failed to execute webhook #{triggered_webhook.webhook_uuid} after #{retry_schedule.size + 1} attempts."
logger.info "Failed to execute webhook #{triggered_webhook.webhook_uuid} after #{retry_schedule.size + 1} attempts."
update_triggered_webhook_status TriggeredWebhook::STATUS_FAILURE
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/pact_broker/webhooks/job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ module Webhooks
end

it "logs that it has failed" do
allow(Job.logger).to receive(:error)
expect(Job.logger).to receive(:error).with(/Failed to execute/)
allow(Job.logger).to receive(:info)
expect(Job.logger).to receive(:info).with(/Failed to execute/)
subject
end

Expand Down

0 comments on commit 700f699

Please sign in to comment.