Using a timer modifies the error message received from the output spawned process

In the following case, why the error message in one run with "exit exception" and the other starts with "exception error"?

1> spawn_link(fun ()-> exit(reason) end).
** exception exit: reason
2> spawn_link(fun ()-> timer:sleep(1), exit(reason) end).
<0.38.0>
** exception error: reason
+3
source share
2 answers

, Erlang. , - Erlang, , , . spawn_link, , , ( ). , .

, . , , , . , , , Pid, ​​ spawn_link, , . , , , - (- ). , .

:

1> spawn_link(fun ()-> timer:sleep(1), exit(reason) end), timer:sleep(1).
** exception exit: reason

, , , , .

0

errors-and-processes

1> link(spawn(fun() -> exit(reason) end)).
** exception exit: reason
2> link(spawn(fun() -> timer:sleep(1000), exit(reason) end)).
true
** exception error: reason

-

+2

All Articles