From 8ab865e1d4a7e2f6c21fe538659717d1fe45c778 Mon Sep 17 00:00:00 2001 From: Bruce Eckel Date: Mon, 22 Jul 2024 16:16:07 -0600 Subject: [PATCH] Update 06_Failure.md --- Chapters/06_Failure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chapters/06_Failure.md b/Chapters/06_Failure.md index d4cc5a5b..68b8d777 100644 --- a/Chapters/06_Failure.md +++ b/Chapters/06_Failure.md @@ -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: @@ -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.