comparison mod_sentry/sentry.lib.lua @ 4995:cb3de818ff55

mod_sentry: Log warning when server returns unexpected response
author Matthew Wild <mwild1@gmail.com>
date Wed, 13 Jul 2022 11:14:04 +0100
parents c13b8003ee5c
children
comparison
equal deleted inserted replaced
4988:732229fe68ab 4995:cb3de818ff55
219 local function resolve_sentry_response(response) 219 local function resolve_sentry_response(response)
220 if response.code == 200 and response.body then 220 if response.code == 200 and response.body then
221 local data = json.decode(response.body); 221 local data = json.decode(response.body);
222 return data; 222 return data;
223 end 223 end
224 module:log("warn", "Unexpected response from server: %d: %s", response.code, response.body);
224 return promise.reject(response); 225 return promise.reject(response);
225 end 226 end
226 227
227 function sentry_mt:send(event) 228 function sentry_mt:send(event)
228 local json_payload = json.encode(event); 229 local json_payload = json.encode(event);