[erlang-questions] Newbie problems with gen_fsm

TA tobias.ammann@REDACTED
Sun May 15 16:26:25 CEST 2016


Hello,

I wrote some code for a parking meter to understand how gen_fsm works. There are two states (awaiting_payment, valid_ticket), two input messages (payment, cancel_ticket), and three output messages (unpaid, change, refund).

I'm getting the following error and don't understand what's wrong. Any pointers?

Error:
** exception exit: {{function_clause,[{gen,do_for_proc,
[{ok,<0.40.0>},#Fun<gen.0.132519590>],
[{file,"gen.erl"},{line,252}]},
{gen_fsm,sync_send_event,2,
[{file,"gen_fsm.erl"},{line,219}]},
{ticketing_fsm,demo1,0,
[{file,"ticketing_fsm.erl"},{line,25}]},
{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]},
{shell,exprs,7,[{file,"shell.erl"},{line,686}]},
{shell,eval_exprs,7,[{file,"shell.erl"},{line,641}]},
{shell,eval_loop,3,[{file,"shell.erl"},{line,626}]}]},
{gen_fsm,sync_send_event,[{ok,<0.40.0>},{payment,100}]}}
in function gen_fsm:sync_send_event/2 (gen_fsm.erl, line 223)
in call from ticketing_fsm:demo1/0 (ticketing_fsm.erl, line 25)

Source: https://transfer.sh/M7n3b/ticketing-fsm.erl

Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160515/3254d0fa/attachment.htm>


More information about the erlang-questions mailing list