<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWProtocolQUIC/ApplicationError/init(code:reason:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network14NWProtocolQUICC16ApplicationErrorV4code6reasonAEs6UInt64V_SSSgtcfc"
  },
  "title" : "init(code:reason:)"
}
-->

# init(code:reason:)

Initializes a QUIC application error with an error code and an optional reason.

```
init(code: UInt64, reason: String? = nil)
```

## Parameters

`code`

The error code.

`reason`

A string that describes the error.

---

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)