[sales] fix: do not crash when fetching state fails
This commit is contained in:
parent
083e341592
commit
8a8e7aed70
|
@ -25,7 +25,8 @@ method enterAsync(state: SaleUnknown) {.async.} =
|
|||
|
||||
try:
|
||||
without requestState =? await market.requestState(agent.requestId):
|
||||
raiseAssert "state unknown"
|
||||
let error = newException(SaleUnknownError, "cannot retrieve request state")
|
||||
await state.switchAsync(SaleErrored(error: error))
|
||||
|
||||
case requestState
|
||||
of RequestState.New, RequestState.Started:
|
||||
|
|
Loading…
Reference in New Issue