diff --git a/nostarch/chapter09.md b/nostarch/chapter09.md index 497aff5edd..37ad79dcfe 100644 --- a/nostarch/chapter09.md +++ b/nostarch/chapter09.md @@ -892,15 +892,17 @@ 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 more of the following: - -Unmatched: ListBullet0 - -Unmatched: ListBullet0 - -Unmatched: ListBullet0 - If someone calls your code and passes in values that don’t make sense, -it’s best to return an error if you can so the user of the library can decide -what they want to do in that case. However, in cases where continuing could be +* The bad state is something that is unexpected, as opposed to something that +will likely happen occasionally, like a user entering data in the wrong format. +* Your code after this point needs to rely on not being in this bad state, +rather than checking for the problem at every step. +* There’s not a good way to encode this information in the types you use. We’ll +work through an example of what we mean in “Encoding States and Behavior as +Types” on page XX. + +If someone calls your code and passes in values that don’t make sense, it’s +best to return an error if you can so the user of the library can decide what +they want to do in that case. However, in cases where continuing could be insecure or harmful, the best choice might be to call `panic!` and alert the person using your library to the bug in their code so they can fix it during development. Similarly, `panic!` is often appropriate if you’re calling diff --git a/tools/docx-to-md.xsl b/tools/docx-to-md.xsl index e48edd8349..d73e7d45cc 100644 --- a/tools/docx-to-md.xsl +++ b/tools/docx-to-md.xsl @@ -89,11 +89,11 @@ - + * - +