Skip to content

Commit 8871ccb

Browse files
committedJan 6, 2021
markdownlint
1 parent ad5daa2 commit 8871ccb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎anti_patterns/catch_panic.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fn main() {
2727
}
2828
```
2929

30-
3130
## Motivation
3231

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

4746
## Disadvantages
47+
4848
4949
`panic::catch_unwind` may not catch all panics in Rust. A panic in Rust is not always
5050
implemented via unwinding, but can be implemented by aborting the process as well.
@@ -62,6 +62,7 @@ TODO:
6262
?-operator to propagate errors
6363
explain why unwinding is bad
6464
other disadvantages of panic::catch_unwind
65+
6566
+ "The example could be improved by adding a function and which panics and catching the panic
6667
in the caller, then matching the Result. Describing the example you could show how by returning
6768
a Result, the Result-ness of the function is described in the signature."

0 commit comments

Comments
 (0)