fix(inferium-harvester): better error handling for fetchRemotePlan
This commit is contained in:
parent
9bd5bbc127
commit
b8fb2390f2
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user