#262 don't ever abort RTU unit parsing on error, just skip

This commit is contained in:
Mikayla Fischler 2023-06-18 14:26:38 -04:00
parent b28e4d1e95
commit af38025f50
3 changed files with 6 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -120,7 +120,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement
if u_type == false then
-- validation fail
log.debug(log_header .. "advertisement unit validation failure")
log.debug(log_header .. "_handle_advertisement(): advertisement unit validation failure")
else
if unit_advert.reactor > 0 then
local target_unit = self.fac_units[unit_advert.reactor] ---@type reactor_unit
@ -146,7 +146,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement
-- skip virtual units
log.debug(util.c(log_header, "skipping virtual RTU unit #", i))
else
log.error(util.c(log_header, "bad advertisement: encountered unsupported reactor-specific RTU type ", type_string))
log.warning(util.c(log_header, "_handle_advertisement(): encountered unsupported reactor-specific RTU type ", type_string))
end
else
-- facility RTUs
@ -172,7 +172,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement
-- skip virtual units
log.debug(util.c(log_header, "skipping virtual RTU unit #", i))
else
log.error(util.c(log_header, "bad advertisement: encountered unsupported reactor-independent RTU type ", type_string))
log.warning(util.c(log_header, "_handle_advertisement(): encountered unsupported facility RTU type ", type_string))
end
end
end
@ -181,9 +181,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement
self.units[i] = unit
unit_count = unit_count + 1
elseif u_type ~= RTU_UNIT_TYPE.VIRTUAL then
_reset_config()
log.error(util.c(log_header, "bad advertisement: error occured while creating a unit (type is ", type_string, ")"))
break
log.warning(util.c(log_header, "_handle_advertisement(): problem occured while creating a unit (type is ", type_string, ")"))
end
end

View File

@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v0.17.7"
local SUPERVISOR_VERSION = "v0.17.8"
local println = util.println
local println_ts = util.println_ts