This is an automated email from the ASF dual-hosted git repository.
abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 67f5aa65e7a Set response type `application/json` in
CustomExceptionMapper to return correct failure message (#17016)
67f5aa65e7a is described below
commit 67f5aa65e7a50f0f9ec323500042ebea4ae39ff3
Author: Rishabh Singh <[email protected]>
AuthorDate: Mon Sep 9 12:07:05 2024 +0530
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
---
.../apache/druid/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<JsonMappingExcepti
"error",
exception.getMessage() == null ? "unknown json mapping
exception" : exception.getMessage()
))
+ .type(MediaType.APPLICATION_JSON)
.build();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]