Skip to content

Commit e51735f

Browse files
committed
Removed return from next.respond(to:) call in responder method
1 parent 19cd31b commit e51735f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/APIErrorMiddleware/APIErrorMiddleware.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public final class APIErrorMiddleware: Middleware, Service, ServiceType {
3939
// If no error is found, succed the promise with the response
4040
// returned by the responder.
4141
do {
42-
return try next.respond(to: request).do({ (response) in
42+
try next.respond(to: request).do { response in
4343
result.succeed(result: response)
44-
}).catch({ (error) in
44+
}.catch { error in
4545
result.succeed(result: self.response(for: error, with: request))
46-
})
46+
}
4747
} catch {
4848
result.succeed(result: self.response(for: error, with: request))
4949
}

0 commit comments

Comments
 (0)