---
title: "replaceError(with:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/result/publisher-swift.struct/replaceerror(with:)"
---

# replaceError(with:)

## Declaration

```swift
func replaceError(with output: Result<Success, Failure>.Publisher.Output) -> Result<Result<Success, Failure>.Publisher.Output, Never>.Publisher
```
