Skip to content

Commit 79bd32a

Browse files
author
Gayathri Sairamkrishnan
committed
Fix typos
1 parent f0a8282 commit 79bd32a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/OpenAPIRuntime/Errors/RuntimeError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import protocol Foundation.LocalizedError
1515
import struct Foundation.Data
1616
import HTTPTypes
17+
1718
/// Error thrown by generated code.
1819
internal enum RuntimeError: Error, CustomStringConvertible, LocalizedError, PrettyStringConvertible {
1920

@@ -147,7 +148,7 @@ extension RuntimeError: HTTPResponseConvertible {
147148
/// HTTP Status code corresponding to each error case
148149
public var httpStatus: HTTPTypes.HTTPResponse.Status {
149150
switch self {
150-
case .invalidServerURL, .invalidServerVariableValue: .notFound
151+
case .invalidServerURL, .invalidServerVariableValue, .pathUnset: .notFound
151152
case .invalidExpectedContentType, .unexpectedContentTypeHeader: .unsupportedMediaType
152153
case .missingCoderForCustomContentType: .unprocessableContent
153154
case .unexpectedAcceptHeader: .notAcceptable
@@ -157,7 +158,6 @@ extension RuntimeError: HTTPResponseConvertible {
157158
.missingRequiredMultipartFormDataContentType, .missingRequiredQueryParameter, .missingRequiredPathParameter,
158159
.missingRequiredRequestBody, .unsupportedParameterStyle:
159160
.badRequest
160-
case .pathUnset: .notFound
161161
case .handlerFailed, .middlewareFailed, .missingRequiredResponseBody, .transportFailed,
162162
.unexpectedResponseStatus, .unexpectedResponseBody:
163163
.internalServerError

Tests/OpenAPIRuntimeTests/Errors/Test_RuntimeError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct MockRuntimeErrorHandler: Sendable {
2929
}
3030

3131
final class Test_RuntimeError: XCTestCase {
32-
func testRuntimeError_withUnderlyingErrorNotConfirming_returns500() async throws {
32+
func testRuntimeError_withUnderlyingErrorNotConforming_returns500() async throws {
3333
let server = UniversalServer(
3434
handler: MockRuntimeErrorHandler(failWithError: RuntimeError.transportFailed(TestError())),
3535
middlewares: [ErrorHandlingMiddleware()]
@@ -49,7 +49,7 @@ final class Test_RuntimeError: XCTestCase {
4949
XCTAssertEqual(response.0.status, .internalServerError)
5050
}
5151

52-
func testRuntimeError_withUnderlyingErrorConfirming_returnsCorrectStatusCode() async throws {
52+
func testRuntimeError_withUnderlyingErrorConforming_returnsCorrectStatusCode() async throws {
5353
let server = UniversalServer(
5454
handler: MockRuntimeErrorHandler(failWithError: TestErrorConvertible.testError("Test Error")),
5555
middlewares: [ErrorHandlingMiddleware()]

0 commit comments

Comments
 (0)