vegapokerbot/internal/handler/fsmwizard/error_state.go
Neur0toxine 1a28ab584a
Some checks are pending
continuous-integration/drone/push Build is running
move fsm wizard to its own package, little refactor
2024-05-13 19:21:34 +03:00

22 lines
520 B
Go

package fsmwizard
import (
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/pkg/fsm"
"go.uber.org/zap"
)
type ErrorState struct {
fsm.ErrorState[Wizard]
log *zap.SugaredLogger
}
func NewErrorState(log *zap.SugaredLogger) *ErrorState {
return &ErrorState{log: log}
}
func (s *ErrorState) Handle(err error, cur fsm.StateID, next fsm.StateID, pl *Wizard, mc fsm.MachineControls[*Wizard]) {
s.log.Errorf("critical wizard error: %s, current state: %s, next state: %s, payload: %#v",
err, cur, next, pl)
mc.Reset()
}