Skip to content

Commit

Permalink
Update 06_Failure.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Eckel committed Jul 22, 2024
1 parent 20e5d0f commit 8ab865e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Chapters/06_Failure.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ import zio.Console.*

def check(t: Temperature) =
defer:
printLine("Checking Temperature").run
printLine("Checking Temperature").orDie.run
if t.degrees > 0 then
ZIO
.succeed:
Expand Down Expand Up @@ -490,8 +490,8 @@ val weatherReport =
weatherReportFaulty.catchAll:
case exception: Exception =>
printLine(exception.getMessage)
// case failure: ClimateFailure =>
// printLine(failure.message)
case failure: ClimateFailure =>
printLine(failure.message)
```

Even though `getTemperature` produces two different types of `ZIO.fail`s, we handle them both in `case exception` because their contained failure objects are both `Exception`s.
Expand Down

0 comments on commit 8ab865e

Please sign in to comment.