Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Kelp GUI: autogen bot endpoint was adding errors incorrectly causing …
Browse files Browse the repository at this point in the history
…a panic
  • Loading branch information
nikhilsaraf committed Apr 17, 2021
1 parent 8002a95 commit 3c47994
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gui/backend/autogenerate_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,25 @@ func (s *APIServer) autogenerateBot(w http.ResponseWriter, r *http.Request) {
go func() {
e := s.setupTestnetAccount(kp.Address(), kp.Seed(), bot.Name)
if e != nil {
s.writeKelpError(req.UserData, w, makeKelpErrorResponseWrapper(
s.addKelpErrorToMap(req.UserData, makeKelpErrorResponseWrapper(
errorTypeBot,
bot.Name,
time.Now().UTC(),
errorLevelError,
fmt.Sprintf("error setting up account for bot '%s': %s\n", bot.Name, e),
))
).KelpError)
return
}

e = s.kos.BotDataForUser(req.UserData.toUser()).AdvanceBotState(bot.Name, kelpos.InitState())
if e != nil {
s.writeKelpError(req.UserData, w, makeKelpErrorResponseWrapper(
s.addKelpErrorToMap(req.UserData, makeKelpErrorResponseWrapper(
errorTypeBot,
bot.Name,
time.Now().UTC(),
errorLevelError,
fmt.Sprintf("error advancing bot state after setting up account for bot '%s': %s\n", bot.Name, e),
))
).KelpError)
return
}
}()
Expand Down

0 comments on commit 3c47994

Please sign in to comment.