---
title: "closeWriteWithError(_:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/neappproxyflow/closewritewitherror(_:)"
---

# closeWriteWithError(_:)

Close the flow for further write operations.

## Declaration

```swift
func closeWriteWithError(_ error: (any Error)?)
```

## Parameters

- `error`: An NSError object indicating to the system the error that led to the closure. If the flow is not being closed due to an error, this parameter should be set to nil. See NEAppProxyFlowError below for a list of acceptable error codes.

## Mentioned in

Handling Flow Copying

## See Also

### Managing the flow life cycle

- [open(withLocalEndpoint:completionHandler:)](networkextension/neappproxyflow/open(withlocalendpoint:completionhandler:).md)
- [closeReadWithError(_:)](networkextension/neappproxyflow/closereadwitherror(_:).md)
