---
title: Publishers.TryMap
framework: combine
role: symbol
role_heading: Structure
path: combine/publishers/trymap
---

# Publishers.TryMap

A publisher that transforms all elements from the upstream publisher with a provided error-throwing closure.

## Declaration

```swift
struct TryMap<Upstream, Output> where Upstream : Publisher
```

## Topics

### Creating a try-map publisher

- [init(upstream:transform:)](combine/publishers/trymap/init(upstream:transform:).md)

### Declaring supporting types

- [Publishers.Output](combine/publishers/output.md)
- [Publishers.TryMap.Failure](combine/publishers/trymap/failure.md)

### Inspecting publisher properties

- [upstream](combine/publishers/trymap/upstream.md)
- [transform](combine/publishers/trymap/transform.md)

### Instance Methods

- [map(_:)](combine/publishers/trymap/map(_:).md)
- [tryMap(_:)](combine/publishers/trymap/trymap(_:).md)

## Relationships

### Conforms To

- [Publisher](combine/publisher.md)

## See Also

### Mapping elements

- [Publishers.Map](combine/publishers/map.md)
- [Publishers.MapError](combine/publishers/maperror.md)
- [Publishers.Scan](combine/publishers/scan.md)
- [Publishers.TryScan](combine/publishers/tryscan.md)
- [Publishers.SetFailureType](combine/publishers/setfailuretype.md)
