@@ -155,7 +155,7 @@ private OperationResult<ResponseType> executeRequest(int httpMethod, Invocation.
155155
156156 private OperationResult <ResponseType > executeRequest (int httpMethod , Invocation .Builder request , Object entity ) {
157157 Response response = null ;
158- if (restrictedHttpMethods && (httpMethod != POST || httpMethod != GET ) ) {
158+ if (restrictedHttpMethods && (httpMethod != POST || httpMethod != GET )) {
159159 request .header ("X-HTTP-Method-Override" , RequestMethod .values ()[httpMethod ].toString ());
160160 response = request .post (Entity .entity (entity , contentType ));
161161 } else {
@@ -181,17 +181,13 @@ private OperationResult<ResponseType> executeRequest(int httpMethod, Invocation.
181181 }
182182
183183 if (response != null && response .getStatus () >= 400 ) {
184- if (handleErrors ) {
185- errorHandler .handleError (response );
186- } else {
187- return (responseGenericType != null ) ? new NullEntityOperationResult <ResponseType >(response , responseGenericType , errorHandler )
188- : new NullEntityOperationResult <ResponseType >(response , responseClass , errorHandler );
189- }
190- errorHandler .handleError (response );
191- } else {
184+ if (!handleErrors ) {
192185 return (responseGenericType != null ) ? new NullEntityOperationResult <ResponseType >(response , responseGenericType , errorHandler )
193186 : new NullEntityOperationResult <ResponseType >(response , responseClass , errorHandler );
187+
194188 }
189+ errorHandler .handleError (response );
190+ }
195191
196192 return (responseGenericType != null ) ? operationResultFactory .getOperationResult (response , responseGenericType )
197193 : operationResultFactory .getOperationResult (response , responseClass );
0 commit comments