Software /
code /
prosody-modules
Changeset
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 | 4988:732229fe68ab |
children | 4996:031e0dd90f4b |
files | mod_sentry/mod_sentry.lua mod_sentry/sentry.lib.lua |
diffstat | 2 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_sentry/mod_sentry.lua Mon Aug 15 15:26:14 2022 +0200 +++ b/mod_sentry/mod_sentry.lua Wed Jul 13 11:14:04 2022 +0100 @@ -29,6 +29,8 @@ end; }; +local serialize = require "util.serialization".serialize; + local function sentry_error_handler(e) module:log("error", "Failed to submit event to sentry: %s", e); end
--- a/mod_sentry/sentry.lib.lua Mon Aug 15 15:26:14 2022 +0200 +++ b/mod_sentry/sentry.lib.lua Wed Jul 13 11:14:04 2022 +0100 @@ -221,6 +221,7 @@ local data = json.decode(response.body); return data; end + module:log("warn", "Unexpected response from server: %d: %s", response.code, response.body); return promise.reject(response); end