pub enum VmError {
DialogueNotStarted,
DialogueNotFinished,
DialogueAlreadyFinished,
DialogueNodeNotFound(NodeName),
ChoiceOutOfRange {
index: usize,
count: usize,
},
WrongResumeEvent,
StepLimitExceeded,
ExprEvalError(EvalError),
NoAvailableChoice,
ChoiceNotAvailable(usize),
}Expand description
Everything that can go wrong while running a Dialogue.
A failed call never changes the state of the VM. After an error it is still suspended exactly where it was, and the host can resume with a valid answer.
Variants§
DialogueNotStarted
DialogueVm::resume was called before DialogueVm::start.
DialogueNotFinished
DialogueVm::start was called while a dialogue is still running.
Starting again is only allowed once the current one is finished.
DialogueAlreadyFinished
DialogueVm::resume was called after DialogueEvent::Finished.
DialogueNodeNotFound(NodeName)
A node was asked for by name, by DialogueVm::start and the
Dialogue has none.
ChoiceOutOfRange
ResumeEvent::Select carried an index no choice has.
WrongResumeEvent
The ResumeEvent does not fit the DialogueEvent the VM emitted,
such as an Advance on a pending choice.
StepLimitExceeded
Too many steps were walked without anything to hand back to the host, which means the dialogue loops on itself.
ExprEvalError(EvalError)
Error when evaluating expression
NoAvailableChoice
No choice are available
ChoiceNotAvailable(usize)
The selected choice was not available
Trait Implementations§
Source§impl Error for VmError
impl Error for VmError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()