Skip to content

[Feature Request/Bug] Enhanced Error Messages #56

Closed
@vaulcul

Description

@vaulcul

I've got a fairly large state machine, and it works for most everything I've been doing. However, I'm currently getting an error and am having a VERY hard time tracking down the line of code that is the culprit (again, large state machine). If the error had some more information as to where it originated from, I think it would be way more useful. It would be nice if it referenced the line or name of the state machine, state, or transition that is causing the error.

Here is the error that needs clarity:

StateMachineException: 
Context: Running OnEnter of the state machine.
Problem: No start state is selected. The state machine needs at least one state to function properly.
Solution: Make sure that there is at least one state in the state machine before running Init() or OnEnter() by calling fsm.AddState(...).

UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].OnEnter () (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:400)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].ChangeState (TStateId name, UnityHFSM.ITransitionListener listener) (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:215)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].OnEnter () (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:386)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].ChangeState (TStateId name, UnityHFSM.ITransitionListener listener) (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:215)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].RequestStateChange (TStateId name, System.Boolean forceInstantly, UnityHFSM.ITransitionListener listener) (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:264)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].TryTransition (UnityHFSM.TransitionBase`1[TStateId] transition) (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:319)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].TryAllDirectTransitions () (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:355)
UnityHFSM.StateMachine`3[TOwnId,TStateId,TEvent].OnLogic () (at Assets/UnityHFSM-v2.1.0/src/StateMachine/StateMachine.cs:414)
Update () (at Assets/Scripts/CharacterController.cs:566)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions