File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ extension Catching {
135135 ) throws ( Self) -> ReturnType {
136136 do {
137137 return try operation ( )
138- } catch let error as Self {
138+ } catch let error as Self { // Avoid nesting if the error is already of the expected type
139139 throw error
140140 } catch {
141141 throw Self . caught ( error)
@@ -182,7 +182,7 @@ extension Catching {
182182 ) async throws ( Self) -> ReturnType {
183183 do {
184184 return try await operation ( )
185- } catch let error as Self {
185+ } catch let error as Self { // Avoid nesting if the error is already of the expected type
186186 throw error
187187 } catch {
188188 throw Self . caught ( error)
Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ Be sure to explore the error chain debugging features to get the full benefit of
262262### Essentials
263263
264264- `` Catching ``
265+ - `` Catching/catch(_:)-8kmn1 ``
265266- `` Catching/catch(_:) ``
266267
267268### System Overloads
You can’t perform that action at this time.
0 commit comments