Skip to content

Commit

Permalink
Merge pull request #4 from vkill/patch-1
Browse files Browse the repository at this point in the history
Support the latest Vapor
  • Loading branch information
anthonycastelli authored May 10, 2018
2 parents 83c2ee4 + 9d0a225 commit 63ca48e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/S3Storage/S3Adapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extension S3Adapter {
request.http.headers = headers
request.http.body = HTTPBody(data: content)
request.http.url = url
return try client.respond(to: request).map(to: ObjectInfo.self) { response in
return client.send(request).map(to: ObjectInfo.self) { response in
guard response.http.status == .ok else {
throw S3AdapterError(identifier: "create", reason: "Couldnt not create file.", source: .capture())
}
Expand All @@ -118,7 +118,7 @@ extension S3Adapter {
request.http.method = .DELETE
request.http.headers = headers
request.http.url = url
return try client.respond(to: request).map(to: Void.self) { response in
return client.send(request).map(to: Void.self) { response in
guard response.http.status == .noContent else {
throw S3AdapterError(identifier: "delete", reason: "Couldnt not delete the file.", source: .capture())
}
Expand All @@ -136,7 +136,7 @@ extension S3Adapter {
request.http.method = .GET
request.http.headers = headers
request.http.url = url
return try client.respond(to: request).map(to: Data.self) { response in
return client.send(request).map(to: Data.self) { response in
guard let data = response.http.body.data else {
throw S3AdapterError(identifier: "get", reason: "Couldnt not extract data from the request.", source: .capture())
}
Expand All @@ -162,7 +162,7 @@ extension S3Adapter {
request.http.method = .GET
request.http.headers = headers
request.http.url = url
return try client.respond(to: request).map(to: [ObjectInfo].self) { response in
return client.send(request).map(to: [ObjectInfo].self) { response in
guard response.http.status == .ok else {
throw S3AdapterError(identifier: "list", reason: "Error: \(response.http.status.reasonPhrase). There requested returned a \(response.http.status.code)", source: .capture())
}
Expand Down

0 comments on commit 63ca48e

Please sign in to comment.