<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEVPNError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:@E@NEVPNError"
  },
  "title" : "NEVPNError.Code"
}
-->

# NEVPNError.Code

Codes that indicate the source of an error.

```
enum Code
```

## Topics

### Error codes

[`NEVPNErrorConfigurationDisabled`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/configurationDisabled)

An error code indicating the VPN configuration associated with the VPN manager isn’t enabled.

[`NEVPNErrorConfigurationInvalid`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/configurationInvalid)

An error code indicating the VPN configuration associated with the VPN manager object is invalid.

[`NEVPNErrorConnectionFailed`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/connectionFailed)

The connection to the VPN server failed.

[`NEVPNErrorConfigurationStale`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/configurationStale)

An error code that indicates another process modfied the VPN configuration since the last time the app loaded the configuration.

[`NEVPNErrorConfigurationReadWriteFailed`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/configurationReadWriteFailed)

An error code that indicates an error occurred while reading or writing the Network Extension preferences.

[`NEVPNErrorConfigurationUnknown`](/documentation/NetworkExtension/NEVPNError-swift.struct/Code/configurationUnknown)

An error code that indicates that unspecified error occurred.

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)