Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public struct HTTPRequestConcludingAsyncReader: ConcludingAsyncReader, ~Copyable
fatalError("Unexpectedly received a request head.")

case .none:
fatalError("The stream unexpectedly ended before receiving a request end.")
throw RequestBodyReadError.streamEndedBeforeReceivingRequestEnd

case .body(let element):
bodyElement = element
Expand Down
24 changes: 24 additions & 0 deletions Sources/NIOHTTPServer/RequestBodyReadError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift HTTP Server open source project
//
// Copyright (c) 2025 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
//
//===----------------------------------------------------------------------===//

enum RequestBodyReadError: Error, CustomStringConvertible {
case streamEndedBeforeReceivingRequestEnd

var description: String {
switch self {
case .streamEndedBeforeReceivingRequestEnd:
"The request stream unexpectedly ended before receiving a request end part."
}
}
}
Loading