diff --git a/Sources/ComposableArchitecture/Effect.swift b/Sources/ComposableArchitecture/Effect.swift index a01a8746767e..009e2bf5d15e 100644 --- a/Sources/ComposableArchitecture/Effect.swift +++ b/Sources/ComposableArchitecture/Effect.swift @@ -98,20 +98,16 @@ extension Effect { return } catch { guard let handler else { - #if DEBUG - var errorDump = "" - customDump(error, to: &errorDump, indent: 4) - runtimeWarn( - """ - An "Effect.run" returned from "\(fileID):\(line)" threw an unhandled error. … + runtimeWarn( + """ + An "Effect.run" returned from "\(fileID):\(line)" threw an unhandled error. … - \(errorDump) + \(String(customDumping: error).indent(by: 4)) - All non-cancellation errors must be explicitly handled via the "catch" parameter \ - on "Effect.run", or via a "do" block. - """ - ) - #endif + All non-cancellation errors must be explicitly handled via the "catch" parameter \ + on "Effect.run", or via a "do" block. + """ + ) return } await handler(error, send) diff --git a/Sources/ComposableArchitecture/Reducer/Reducers/IfCaseLetReducer.swift b/Sources/ComposableArchitecture/Reducer/Reducers/IfCaseLetReducer.swift index b5ecaf830fcf..1ee9c56bd2fb 100644 --- a/Sources/ComposableArchitecture/Reducer/Reducers/IfCaseLetReducer.swift +++ b/Sources/ComposableArchitecture/Reducer/Reducers/IfCaseLetReducer.swift @@ -191,19 +191,15 @@ public struct _IfCaseLetReducer: Reducer { guard let childAction = self.toChildAction.extract(from: action) else { return .none } guard var childState = self.toChildState.extract(from: state) else { - var actionDump = "" - customDump(action, to: &actionDump, indent: 4) - var stateDump = "" - customDump(state, to: &stateDump, indent: 4) runtimeWarn( """ An "ifCaseLet" at "\(self.fileID):\(self.line)" received a child action when child state \ was set to a different case. … Action: - \(actionDump) + \(String(customDumping: action).indent(by: 4)) State: - \(stateDump) + \(String(customDumping: state).indent(by: 4)) This is generally considered an application logic error, and can happen for a few reasons: diff --git a/Sources/ComposableArchitecture/Reducer/Reducers/IfLetReducer.swift b/Sources/ComposableArchitecture/Reducer/Reducers/IfLetReducer.swift index 4b848acd09b1..14dbc85edd21 100644 --- a/Sources/ComposableArchitecture/Reducer/Reducers/IfLetReducer.swift +++ b/Sources/ComposableArchitecture/Reducer/Reducers/IfLetReducer.swift @@ -256,15 +256,13 @@ public struct _IfLetReducer: Reducer { guard let childAction = self.toChildAction.extract(from: action) else { return .none } guard state[keyPath: self.toChildState] != nil else { - var actionDump = "" - customDump(action, to: &actionDump, indent: 4) runtimeWarn( """ An "ifLet" at "\(self.fileID):\(self.line)" received a child action when child state was \ "nil". … Action: - \(actionDump) + \(String(customDumping: action).indent(by: 4)) This is generally considered an application logic error, and can happen for a few reasons: