smanza
How to detect errors in :gen_statem?
Hello.
I wrote few :gen_statem processes, but when I want to test them if there is some bug in the code for example FunctionClause errors, iex don’t throw like it will do with a GenServer.
Did you ever find this issue and how did you fix it ?
Thanks
Most Liked
rvirding
Try going to hex http://hex.pm/ and downloading gen_state_machine which provides a more Elixir like interface to the gen_statem OTP behaviour. This might help. Otherwise shouldn’t the FunctionClause error tell you in which function the error occurred?
rvirding
To be a bit picky here
you use call when the semantics of what you are doing is synchronous and there is a reply to your request which you wish to receive or maybe if you need to wait until it has been done. Again it’s the semantics which decide. If you just want to “tell” the server/state machine something then you would do a cast.







