Skip to content

Commit

Permalink
chore: add erorr message on initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Jun 12, 2024
1 parent 9fb7188 commit 6ae732e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ant/src/process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,15 @@ function process.handle(msg, ao)
function(msg)
local status, state = pcall(json.decode(msg.Data))
assert(status, "Invalid state provided")
local _, initResult = pcall(initialize.initializeANTState, state)
ao.send({ Target = msg.From, Data = initResult })
local status, result = pcall(initialize.initializeANTState, state)

if not status then
ao.send({ Target = msg.From, Data = result, Error="Initialize-State-Error" })
return
else
ao.send({ Target = msg.From, Data = result })
end

end
)

Expand Down

0 comments on commit 6ae732e

Please sign in to comment.