Skip to content

Commit

Permalink
add: self needs to referenced explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
wibed committed Oct 4, 2020
1 parent 93422af commit fe200bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/SendGridKit/SendGridClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ public struct SendGridClient {
eventLoop: .delegate(on: self.eventLoop)).flatMap { response in
switch response.status {
case .ok, .accepted:
return eventLoop.makeSucceededFuture(())
return self.eventLoop.makeSucceededFuture(())
default:
// JSONDecoder will handle empty body by throwing decoding error
let byteBuffer = response.body ?? ByteBuffer(.init())
let responseData = Data(byteBuffer.readableBytesView)

do {
let error = try self.decoder.decode(SendGridError.self, from: responseData)
return eventLoop.makeFailedFuture(error)
return self.eventLoop.makeFailedFuture(error)
} catch {
return eventLoop.makeFailedFuture(error)
return self.eventLoop.makeFailedFuture(error)
}
}
}
Expand All @@ -91,14 +91,14 @@ public struct SendGridClient {

let body = try encoder.encode(email)

return eventLoop.makeSucceededFuture(
return self.eventLoop.makeSucceededFuture(
try HTTPClient.Request(url: url,
method: method,
headers: headers,
body: .data(body))
)
} catch {
return eventLoop.makeFailedFuture(error)
return self.eventLoop.makeFailedFuture(error)
}
}
}

0 comments on commit fe200bb

Please sign in to comment.