Skip to content

Commit 0d40a53

Browse files
committed
Merge pull request #101 from joeltgf/master
Change "success" response status code in Java ApiInvoker to all 2xx responses vs. just 200.
2 parents 59da358 + c779905 commit 0d40a53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/resources/Java/apiInvoker.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import com.sun.jersey.api.client.config.DefaultClientConfig;
1212
import com.sun.jersey.api.client.filter.LoggingFilter;
1313
import com.sun.jersey.api.client.WebResource.Builder;
1414

15+
import javax.ws.rs.core.Response.Status.Family;
1516
import javax.ws.rs.core.MediaType;
1617

1718
import java.util.Map;
@@ -123,7 +124,7 @@ public class ApiInvoker {
123124
else {
124125
throw new ApiException(500, "unknown method type " + method);
125126
}
126-
if(response.getClientResponseStatus() == ClientResponse.Status.OK) {
127+
if(response.getClientResponseStatus().getFamily() == Family.SUCCESSFUL) {
127128
return (String) response.getEntity(String.class);
128129
}
129130
else {

0 commit comments

Comments
 (0)