Skip to content

Commit 4e7c638

Browse files
author
Gayathri Sairamkrishnan
committed
Fix formatting issues
1 parent a4f5df4 commit 4e7c638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/OpenAPIRuntime/Interface/ErrorHandlingMiddleware.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ import HTTPTypes
4444
/// ```
4545
/// - Note: The placement of ``ErrorHandlingMiddleware`` in the middleware chain is important. It should be determined based on the specific needs of each application. Consider the order of execution and dependencies between middlewares.
4646
public struct ErrorHandlingMiddleware: ServerMiddleware {
47-
4847
/// Creates a new middleware.
4948
public init() {}
50-
5149
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
5250
public func intercept(
5351
_ request: HTTPTypes.HTTPRequest,
@@ -58,7 +56,9 @@ public struct ErrorHandlingMiddleware: ServerMiddleware {
5856
async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?)
5957
) async throws -> (HTTPTypes.HTTPResponse, OpenAPIRuntime.HTTPBody?) {
6058
do { return try await next(request, body, metadata) } catch {
61-
if let serverError = error as? ServerError, let appError = serverError.underlyingError as? (any HTTPResponseConvertible) {
59+
if let serverError = error as? ServerError,
60+
let appError = serverError.underlyingError as? (any HTTPResponseConvertible)
61+
{
6262
return (
6363
HTTPResponse(status: appError.httpStatus, headerFields: appError.httpHeaderFields),
6464
appError.httpBody

0 commit comments

Comments
 (0)