From b8fb2390f27fc6b11d2987b94c0376b818f9c277 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Tue, 21 May 2024 23:52:09 +0200 Subject: [PATCH] fix(inferium-harvester): better error handling for fetchRemotePlan --- inferium-harvester.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inferium-harvester.lua b/inferium-harvester.lua index 8ce9e1c..a49bd3f 100644 --- a/inferium-harvester.lua +++ b/inferium-harvester.lua @@ -280,15 +280,19 @@ local function fetchRemotePlan() local replyMessage, errMessage = net.sendQuery(INFERIUM_SERVER, message, NETWORK_TIMEOUT) if replyMessage and replyMessage.payload then previouslyFetchedRemotePlan = replyMessage.payload + print('> plan fetched') return replyMessage.payload elseif previouslyFetchedRemotePlan then - print('> failed to fetch remote plan, use the previous one instead') + print('> failed to fetch: ' .. tostring(errMessage)) + print('> use the previous recorded remote plan instead') return previouslyFetchedRemotePlan elseif not replyMessage and errMessage then if lastErrMessage ~= errMessage then lastErrMessage = errMessage print('> failed to fetch: ' .. tostring(errMessage)) end + else + error('unknown error during fetch') end os.sleep(IDLE_TIME)