Skip to content

Commit

Permalink
Re-order Advanced lessons
Browse files Browse the repository at this point in the history
  • Loading branch information
doomspork committed Feb 3, 2016
1 parent ac625e9 commit 0a914c8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lessons/advanced/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: page
title: Concurrency
category: advanced
order: 3
order: 4
lang: en
---

Expand Down
8 changes: 4 additions & 4 deletions lessons/advanced/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
layout: page
title: Error Handling
category: advanced
order: 7
order: 2
lang: en
---

Although more common to return the `{:error, reason}` tuple, Elixir supports exceptions and in this lesson we'll look at how to handle errors and the different mechanisms available to us.

In general the convention in Elixir is to create a function (`example/1`) which returns `{:ok, result}` and `{:error, reason}` and a separate function (`example!/1`) that returns the unwrapped `result` or raises an error.
In general the convention in Elixir is to create a function (`example/1`) which returns `{:ok, result}` and `{:error, reason}` and a separate function (`example!/1`) that returns the unwrapped `result` or raises an error.

This lesson will focus on interacting with the latter.

Expand Down Expand Up @@ -147,12 +147,12 @@ iex> spawn_link fn -> exit("oh no") end
```

While it is possible to catch an exit with `try/catch` doing so is _extremely_ rare. In almost all cases it is advantagous to let the supervisor handle the process exit:

```elixir
iex> try do
...> exit "oh no!"
...> catch
...> :exit, _ -> "exit blocked"
...> end
"exit blocked"
```
```
2 changes: 1 addition & 1 deletion lessons/advanced/escripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: page
title: Executables
category: advanced
order: 2
order: 3
lang: en
---

Expand Down
2 changes: 1 addition & 1 deletion lessons/advanced/metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: page
title: Metaprogramming
category: advanced
order: 6
order: 7
lang: en
---

Expand Down
2 changes: 1 addition & 1 deletion lessons/advanced/otp-concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: page
title: OTP Concurrency
category: advanced
order: 4
order: 5
lang: en
---

Expand Down
2 changes: 1 addition & 1 deletion lessons/advanced/otp-supervisors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: page
title: OTP Supervisors
category: advanced
order: 5
order: 6
lang: en
---

Expand Down

0 comments on commit 0a914c8

Please sign in to comment.