mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-07-07 05:18:55 +00:00
Log response only if status code is not "201 Created"
This commit is contained in:
parent
049f9873af
commit
684c2048d7
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ module Agents
|
||||||
mo = interpolated(event)
|
mo = interpolated(event)
|
||||||
begin
|
begin
|
||||||
response = HTTParty.post(endpoint_for(mo['type']), body: payload_for(mo), headers: headers)
|
response = HTTParty.post(endpoint_for(mo['type']), body: payload_for(mo), headers: headers)
|
||||||
response.code == 201 ? log(response.body) : error(response.body)
|
error(response.body) if response.code != 201
|
||||||
rescue HTTParty::Error => e
|
rescue HTTParty::Error => e
|
||||||
error(e.message)
|
error(e.message)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue