diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java index 4dfb66ba706c..c15698803d9f 100644 --- a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java +++ b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapter.java @@ -153,7 +153,8 @@ private Task toTaskUsingDeepStorage(Job from) throws IOException com.google.common.base.Optional taskBody = taskLogs.streamTaskPayload(getTaskId(from).getOriginalTaskId()); if (!taskBody.isPresent()) { throw InternalServerError.exception( - "Could not load task payload from deep storage for job [%s]. Check the overlord logs for any errors in uploading task payload to deep storage.", + "Could not load task payload from deep storage for job [%s]." + + " Check the overlord logs for any errors in uploading task payload to deep storage.", from.getMetadata().getName() ); } diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java index 87a27688902b..c22fa5869d8c 100644 --- a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java +++ b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java @@ -188,7 +188,8 @@ private Task toTaskUsingDeepStorage(Job from) throws IOException com.google.common.base.Optional taskBody = taskLogs.streamTaskPayload(getTaskId(from).getOriginalTaskId()); if (!taskBody.isPresent()) { throw InternalServerError.exception( - "Could not load task payload from deep storage for job [%s]. Check the overlord logs for errors uploading task payloads to deep storage.", + "Could not load task payload from deep storage for job [%s]." + + " Check the overlord logs for errors uploading task payloads to deep storage.", from.getMetadata().getName() ); } diff --git a/processing/src/main/java/org/apache/druid/error/InternalServerError.java b/processing/src/main/java/org/apache/druid/error/InternalServerError.java index 4ba221920d56..6369546df336 100644 --- a/processing/src/main/java/org/apache/druid/error/InternalServerError.java +++ b/processing/src/main/java/org/apache/druid/error/InternalServerError.java @@ -21,25 +21,24 @@ public class InternalServerError extends BaseFailure { - public static DruidException exception(String errorCode, String msg, Object... args) + public static DruidException exception(String msg, Object... args) { - return exception(null, errorCode, msg, args); + return exception(null, msg, args); } - public static DruidException exception(Throwable t, String errorCode, String msg, Object... args) + public static DruidException exception(Throwable t, String msg, Object... args) { - return DruidException.fromFailure(new InternalServerError(t, errorCode, msg, args)); + return DruidException.fromFailure(new InternalServerError(t, msg, args)); } private InternalServerError( Throwable t, - String errorCode, String msg, Object... args ) { super( - errorCode, + "internalServerError", DruidException.Persona.OPERATOR, DruidException.Category.RUNTIME_FAILURE, t, msg, args diff --git a/processing/src/test/java/org/apache/druid/error/InternalServerErrorTest.java b/processing/src/test/java/org/apache/druid/error/InternalServerErrorTest.java index b28296b2c415..13672bea6903 100644 --- a/processing/src/test/java/org/apache/druid/error/InternalServerErrorTest.java +++ b/processing/src/test/java/org/apache/druid/error/InternalServerErrorTest.java @@ -31,14 +31,14 @@ public class InternalServerErrorTest @Test public void testAsErrorResponse() { - ErrorResponse errorResponse = new ErrorResponse(InternalServerError.exception("runtimeFailure", "Internal Server Error")); + ErrorResponse errorResponse = new ErrorResponse(InternalServerError.exception("Internal Server Error")); final Map asMap = errorResponse.getAsMap(); MatcherAssert.assertThat( asMap, DruidMatchers.mapMatcher( "error", "druidException", - "errorCode", "runtimeFailure", + "errorCode", "internalServerError", "persona", "OPERATOR", "category", "RUNTIME_FAILURE", "errorMessage", "Internal Server Error" @@ -52,7 +52,7 @@ public void testAsErrorResponse() new DruidExceptionMatcher( DruidException.Persona.OPERATOR, DruidException.Category.RUNTIME_FAILURE, - "runtimeFailure" + "internalServerError" ).expectMessageContains("Internal Server Error") ); }