Currently, if the parser fails due to an incorrect parameter type, it throws an exception. But it doesn't tell you anything helpful (the example case is using fc.CurrentThrust(1) instead of fc.CurrentThrust(true). There's an NRE call stack, and you can kind-of guess because the MASComponent or MASPage feature that failed has its constructor in the call stack.
Improvements:
[x] Trap the exception in MASFlightComputer.GetVariable() so I can report the variable token that's failing.
[x] Maybe add some null checks in MASFlightComputer.GenerateOperatorVariable? That's where the NRE in this example fired.
Currently, if the parser fails due to an incorrect parameter type, it throws an exception. But it doesn't tell you anything helpful (the example case is using
fc.CurrentThrust(1)
instead offc.CurrentThrust(true)
. There's an NRE call stack, and you can kind-of guess because the MASComponent or MASPage feature that failed has its constructor in the call stack.Improvements: