Skip to content

Commit

Permalink
markdownlint
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan committed Jan 6, 2021
1 parent ad5daa2 commit 8871ccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion anti_patterns/catch_panic.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ fn main() {
}
```


## Motivation

In rust, there are two ways an operation can fail: An expected problem, like a
Expand All @@ -45,6 +44,7 @@ valid response if the route for that request (as in: logic outside of the web se
implementor's control) is producing a panic.

## Disadvantages

`panic::catch_unwind` may not catch all panics in Rust. A panic in Rust is not always
implemented via unwinding, but can be implemented by aborting the process as well.
Expand All @@ -62,6 +62,7 @@ TODO:
?-operator to propagate errors
explain why unwinding is bad
other disadvantages of panic::catch_unwind

+ "The example could be improved by adding a function and which panics and catching the panic
in the caller, then matching the Result. Describing the example you could show how by returning
a Result, the Result-ness of the function is described in the signature."
Expand Down

0 comments on commit 8871ccb

Please sign in to comment.