From 67f5aa65e7a50f0f9ec323500042ebea4ae39ff3 Mon Sep 17 00:00:00 2001 From: Rishabh Singh <6513075+findingrish@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:07:05 +0530 Subject: [PATCH] Set response type `application/json` in CustomExceptionMapper to return correct failure message (#17016) * Add produces annotation to ParallelIndexSupervisorTask#report * change to application/json * Set response type in CustomExceptionMapper instead --- .../server/initialization/jetty/CustomExceptionMapper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/org/apache/druid/server/initialization/jetty/CustomExceptionMapper.java b/server/src/main/java/org/apache/druid/server/initialization/jetty/CustomExceptionMapper.java index 2b1b8351aed..18148b0c348 100644 --- a/server/src/main/java/org/apache/druid/server/initialization/jetty/CustomExceptionMapper.java +++ b/server/src/main/java/org/apache/druid/server/initialization/jetty/CustomExceptionMapper.java @@ -23,6 +23,7 @@ package org.apache.druid.server.initialization.jetty; import com.fasterxml.jackson.databind.JsonMappingException; import com.google.common.collect.ImmutableMap; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; @@ -38,6 +39,7 @@ public class CustomExceptionMapper implements ExceptionMapper