#442 return rather than assert on configuration error

This commit is contained in:
Mikayla Fischler
2024-03-05 20:17:52 -05:00
parent 1bc4828010
commit 0892a57d35
5 changed files with 35 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.2.9"
local SUPERVISOR_VERSION = "v1.2.10"
local println = util.println
local println_ts = util.println_ts
@@ -34,9 +34,13 @@ if not supervisor.load_config() then
-- try to reconfigure (user action)
local success, error = configure.configure(true)
if success then
assert(supervisor.load_config(), "failed to load valid configuration")
if not supervisor.load_config() then
println("failed to load a valid configuration, please reconfigure")
return
end
else
assert(success, "supervisor configuration error: " .. error)
println("configuration error: " .. error)
return
end
end