[erlang-questions] Recommended way to crash gen_server

Albin Stigö <>
Sat Jul 8 12:18:45 CEST 2017


Hello,

I have a gen_server communicating with a port program I wrote in C.

If I receive any unexpected data (or timeout) from the port I want to
crash the gen_server.

Regarding crashing, Is the recommended approach to return {stop,
Reason} or should I exit(Reason) or maybe even throw(Reason).

I want my supervisor to try to restart the gen_server according to the
strategy/intensity I've chosen.


--Albin


More information about the erlang-questions mailing list