<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFReadStreamGetError(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFReadStreamGetError"
  },
  "title" : "CFReadStreamGetError(_:)"
}
-->

# CFReadStreamGetError(_:)

Returns the error status of a stream.

```
func CFReadStreamGetError(_ stream: CFReadStream!) -> CFStreamError
```

## Parameters

`stream`

The stream to examine.

## Return Value

The error status of `stream` returned in a [`CFStreamError`](/documentation/CoreFoundation/CFStreamError) structure.

## Discussion

The error field is `0` if no error has occurred. If the error field is not `0`, the `domain` field contains a code that identifies the domain in which the value of the `error` field should be interpreted.

---

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)