-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathNIOHTTPServerConfigurationError.swift
More file actions
33 lines (29 loc) · 1.27 KB
/
NIOHTTPServerConfigurationError.swift
File metadata and controls
33 lines (29 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2026 Apple Inc. and the Swift HTTP Server project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Swift HTTP Server project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
/// A configuration error arising from an invalid ``NIOHTTPServerConfiguration``.
enum NIOHTTPServerConfigurationError: Error, CustomStringConvertible {
case noSupportedHTTPVersionsSpecified
case incompatibleTransportSecurity
case invalidMaxConnections
var description: String {
switch self {
case .noSupportedHTTPVersionsSpecified:
"Invalid configuration: at least one supported HTTP version must be specified."
case .incompatibleTransportSecurity:
"Invalid configuration: only HTTP/1.1 can be served over plaintext. `transportSecurity` must be set to (m)TLS for serving HTTP/2."
case .invalidMaxConnections:
"Invalid configuration: `maxConnections` must be greater than 0."
}
}
}