Skip to content

Commit 517ba87

Browse files
committed
clarify statement about raising a message inside spawn/1
1 parent 092e1aa commit 517ba87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

getting_started/11.markdown

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,17 @@ The most common form of spawning in Elixir is actually via `spawn_link/1`. Befor
105105

106106
```iex
107107
iex> spawn fn -> raise "oops" end
108+
109+
[error] Error in process <0.58.0> with exit value: ...
110+
108111
#PID<0.58.0>
109112
```
110113

111-
Well... nothing happened. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
114+
It merely logged an error but the spawning process is still running. That's because processes are isolated. If we want the failure in one process to propagate to another one, we should link them. This can be done with `spawn_link/1`:
112115

113116
```iex
114117
iex> spawn_link fn -> raise "oops" end
115-
#PID<0.60.0>
118+
116119
** (EXIT from #PID<0.41.0>) an exception was raised:
117120
** (RuntimeError) oops
118121
:erlang.apply/2

0 commit comments

Comments
 (0)