<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Fail",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine4FailV"
  },
  "title" : "Fail"
}
-->

# Fail

A publisher that immediately terminates with the specified error.

```
struct Fail<Output, Failure> where Failure : Error
```

## Topics

### Creating a fail publisher

[`init(error:)`](/documentation/Combine/Fail/init(error:))

Creates a publisher that immediately terminates with the specified failure.

[`init(outputType:failure:)`](/documentation/Combine/Fail/init(outputType:failure:))

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

### Inspecting publisher properties

[`error`](/documentation/Combine/Fail/error)

The failure to send when terminating the publisher.

### Comparing publishers

[`==(_:_:)`](/documentation/Combine/Fail/==(_:_:))

Returns a Boolean value that indicates whether two publishers are equivalent.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)