Well, the answer is I need a different return value, in this case ok
.
terminate(Reason, #state{port=Port}) ->
lager:info("Terminating ~p due to ~p", [?MODULE, Reason]),
catch port_close(Port),
ok.
I'm still a bit confused since the documentation states for terminate/2
that The return value is ignored.