You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ab...@apache.org on 2024/09/09 06:37:11 UTC
(druid) branch master updated: Set response type `application/json` in CustomExceptionMapper to return correct failure message (#17016)
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 <65...@users.noreply.github.com>
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org