---
title: "init(outputType:failure:)"
framework: combine
role: symbol
role_heading: Initializer
path: "combine/fail/init(outputtype:failure:)"
---

# init(outputType:failure:)

Creates publisher with the given output type, that immediately terminates with the specified failure.

## Declaration

```swift
init(outputType: Output.Type, failure: Failure)
```

## Parameters

- `outputType`: The output type exposed by this publisher.
- `failure`: The failure to send when terminating the publisher.

## Discussion

Discussion Use this initializer to create a Fail publisher that can work with subscribers or publishers that expect a given output type.

## See Also

### Creating a fail publisher

- [init(error:)](combine/fail/init(error:).md)
