[erlang-questions] getting the error (after the fact) in an Erlang process?

Vans S vans_163@REDACTED
Wed Mar 1 22:06:47 CET 2017


Before I was doing something like:

spawn_monitor(fun() -> {ok, F} = file:open("/hi", [write]), group_leader(F, self()) end).

Now this processes error messages after a crash out go to the hi file.


Now what I have is a [1] supervisor -> [1] gen_server, trap_exit, start_link -> [many] gen_statem

When the gen_statem changes group_leader like that to a file, the errors do not go to the file.

Is this because of how gen_*,trap_exit, and start_link work and whatnot?

Does anyone know a way to keep this relationship but also have the error+stacktrace forwarded to the
group leader?



More information about the erlang-questions mailing list