File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
modules/swagger-codegen/src/main/resources/Java Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ public class ApiInvoker {
226
226
}
227
227
else if ("DELETE".equals(method)) {
228
228
if (body == null)
229
- response = builder.delete(ClientResponse.class, serialize(body) );
229
+ response = builder.delete(ClientResponse.class);
230
230
else
231
231
response = builder.type(contentType).delete(ClientResponse.class, serialize(body));
232
232
}
@@ -237,12 +237,26 @@ public class ApiInvoker {
237
237
return null;
238
238
}
239
239
else if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
240
- return (String) response.getEntity(String.class);
240
+ if (response.hasEntity()) {
241
+ return (String) response.getEntity(String.class);
242
+ }
243
+ else {
244
+ return " " ;
245
+ }
241
246
}
242
247
else {
248
+ String message = " error" ;
249
+ if (response.hasEntity()) {
250
+ try{
251
+ message = String.valueOf(response.getEntity(String.class));
252
+ }
253
+ catch (RuntimeException e) {
254
+ // e.printStackTrace();
255
+ }
256
+ }
243
257
throw new ApiException(
244
258
response.getClientResponseStatus().getStatusCode(),
245
- response.getEntity(String.class) );
259
+ message );
246
260
}
247
261
}
248
262
You can’t perform that action at this time.
0 commit comments