@@ -146,7 +146,7 @@ class ExposeeServiceClient: ExposeeServiceClientProtocol {
146
146
completion ( . success( . init( data: nil , publishedUntil: publishedUntil) ) )
147
147
return
148
148
default :
149
- completion ( . failure( . HTTPFailureResponse( status: httpStatus) ) )
149
+ completion ( . failure( . HTTPFailureResponse( status: httpStatus, data : data ) ) )
150
150
return
151
151
}
152
152
@@ -200,7 +200,7 @@ class ExposeeServiceClient: ExposeeServiceClientProtocol {
200
200
}
201
201
request. httpBody = payload
202
202
203
- let task = urlSession. dataTask ( with: request, completionHandler: { _ , response, error in
203
+ let task = urlSession. dataTask ( with: request, completionHandler: { data , response, error in
204
204
guard error == nil else {
205
205
completion ( . failure( . networkSessionError( error: error!) ) )
206
206
return
@@ -212,7 +212,7 @@ class ExposeeServiceClient: ExposeeServiceClientProtocol {
212
212
213
213
let statusCode = httpResponse. statusCode
214
214
guard statusCode == 200 else {
215
- completion ( . failure( . HTTPFailureResponse( status: statusCode) ) )
215
+ completion ( . failure( . HTTPFailureResponse( status: statusCode, data : data ) ) )
216
216
return
217
217
}
218
218
@@ -246,7 +246,7 @@ class ExposeeServiceClient: ExposeeServiceClientProtocol {
246
246
}
247
247
request. httpBody = payload
248
248
249
- let task = urlSession. dataTask ( with: request, completionHandler: { _ , response, error in
249
+ let task = urlSession. dataTask ( with: request, completionHandler: { data , response, error in
250
250
guard error == nil else {
251
251
completion ( . failure( . networkSessionError( error: error!) ) )
252
252
return
@@ -258,7 +258,7 @@ class ExposeeServiceClient: ExposeeServiceClientProtocol {
258
258
259
259
let statusCode = httpResponse. statusCode
260
260
guard statusCode == 200 else {
261
- completion ( . failure( . HTTPFailureResponse( status: statusCode) ) )
261
+ completion ( . failure( . HTTPFailureResponse( status: statusCode, data : data ) ) )
262
262
return
263
263
}
264
264
0 commit comments