---
title: "mapError(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/result/publisher-swift.struct/maperror(_:)"
---

# mapError(_:)

## Declaration

```swift
func mapError<E>(_ transform: (Failure) -> E) -> Result<Result<Success, Failure>.Publisher.Output, E>.Publisher where E : Error
```
