Mercurial > prosody-hg
changeset 13980:d8c001271669
Merge 13.0->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 07 Oct 2025 19:09:25 +0200 |
| parents | d520cee2bbdb (current diff) 2041c347c178 (diff) |
| children | 350e16e5f9aa |
| files | util/startup.lua |
| diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/startup.lua Tue Oct 07 12:15:19 2025 +0100 +++ b/util/startup.lua Tue Oct 07 19:09:25 2025 +0200 @@ -351,6 +351,10 @@ elseif level == "file" then log("error", "Couldn't read the config file when trying to reload: %s", err); end + prosody.events.fire_event("config-reload-failed", { + filename = prosody.config_file; + level = level; error = err; + }); else prosody.events.fire_event("config-reloaded", { filename = prosody.config_file, @@ -863,6 +867,15 @@ prosody.events.add_handler("reloading-config", function() notify_socket:send(string.format("RELOADING=1\nMONOTONIC_USEC=%d", math.floor(time.monotonic() * 1000000))); end); + prosody.events.add_handler("config-reload-failed", function(event) + if event and event.level == "parser" then + notify_socket:send(string.format("READY=1\nSTATUS=Error parsing configuration file: %s", tostring(event.error))); + elseif event and event.level == "file" then + notify_socket:send(string.format("READY=1\nSTATUS=Could not read configuration file: %s", tostring(event.error))); + else + notify_socket:send("READY=1\nSTATUS=Could not read configuration file"); + end + end); prosody.events.add_handler("config-reloaded", function() notify_socket:send("READY=1"); end);
