Update ch09-03-to-panic-or-not-to-panic.md

This commit is contained in:
aaaxx 2017-01-07 06:27:03 +01:00 committed by GitHub
parent 871ebab8df
commit c88e602b7b

View File

@ -73,9 +73,9 @@ we'd definitely want to handle the `Result` in a more robust way instead.
### Guidelines for Error Handling
It's advisable to have your code `panic!` when it's possible that you could end
up in a *bad state*---in this context, *bad state* is when some assumption,
up in a *bad state*in this context, *bad state* is when some assumption,
guarantee, contract, or invariant has been broken, such as when invalid values,
contradictory values, or missing values are passed to your code---plus one or
contradictory values, or missing values are passed to your codeplus one or
more of the following:
* The bad state is not something that's *expected* to happen occasionally