13 lines
304 B
Nim
13 lines
304 B
Nim
|
import ../statemachine
|
||
|
import ./error
|
||
|
|
||
|
type
|
||
|
PurchaseFailed* = ref object of PurchaseState
|
||
|
|
||
|
method enter*(state: PurchaseFailed) =
|
||
|
let error = newException(PurchaseError, "Purchase failed")
|
||
|
state.switch(PurchaseErrored(error: error))
|
||
|
|
||
|
method description*(state: PurchaseFailed): string =
|
||
|
"failed"
|