diff --git a/rest/src/main/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapper.java b/rest/src/main/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapper.java index a1d386fa8..686ba5017 100644 --- a/rest/src/main/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapper.java +++ b/rest/src/main/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapper.java @@ -25,6 +25,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.resource.NoResourceFoundException; @@ -58,6 +59,7 @@ public class ApplicationExceptionMapper { @ExceptionHandler(ClientAbortException.class) @Order(ValidationExceptionMapper.ORDER + 1) + @ResponseStatus(HttpStatus.NO_CONTENT) public void handleClientAborted( HttpServletRequest request, ClientAbortException clientAbortException) { logException( @@ -78,7 +80,7 @@ public ResponseEntity handleAll(HttpServletRequest request, Throw .findAny(); if (clientAbortedException.isPresent()) { handleClientAborted(request, (ClientAbortException) clientAbortedException.get()); - return ResponseEntity.ok().build(); + return ResponseEntity.noContent().build(); } logException(request, th); diff --git a/rest/src/test/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapperTest.java b/rest/src/test/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapperTest.java index cad107958..52770fd0f 100644 --- a/rest/src/test/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapperTest.java +++ b/rest/src/test/java/com/netflix/conductor/rest/controllers/ApplicationExceptionMapperTest.java @@ -108,7 +108,7 @@ public void testClientAbortException() throws Exception { new ObjectMapper() .writeValueAsString(Collections.emptyMap()))) .andDo(print()) - .andExpect(status().isOk()); + .andExpect(status().isNoContent()); // verify the error was logged verify(logger) .error( @@ -138,7 +138,7 @@ public void testClientAbortExceptionChained() throws Exception { new ObjectMapper() .writeValueAsString(Collections.emptyMap()))) .andDo(print()) - .andExpect(status().isOk()); + .andExpect(status().isNoContent()); // verify the error was logged verify(logger) .error(