{"record":{"id":"070e0ec0bdfe0e1a","repo":"apache/druid","slug":"this-jobby-does-not-implement-geterrormessage-j","errorCode":null,"errorMessage":"This Jobby does not implement getErrorMessage(), Jobby class: [%s]","messagePattern":"This Jobby does not implement getErrorMessage\\(\\), Jobby class: \\[(.+?)\\]","errorType":"exception","errorClass":"UOE","httpStatus":null,"severity":"warning","filePath":"processing/src/main/java/org/apache/druid/indexer/Jobby.java","lineNumber":49,"sourceCode":"  boolean run();\n\n  /**\n   * @return A map containing statistics for a Jobby, optionally null if the Jobby is unable to provide stats.\n   */\n  @Nullable\n  default Map<String, Object> getStats()\n  {\n    throw new UOE(\"This Jobby does not implement getJobStats(), Jobby class: [%s]\", getClass());\n  }\n\n  /**\n   * @return A string representing the error that caused a Jobby to fail. Can be null if the Jobby did not fail,\n   * or is unable to provide an error message.\n   */\n  @Nullable\n  default String getErrorMessage()\n  {\n    throw new UOE(\"This Jobby does not implement getErrorMessage(), Jobby class: [%s]\", getClass());\n  }\n}\n","sourceCodeStart":31,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/indexer/Jobby.java#L31-L52","documentation":"Jobby's default getErrorMessage() is a stub that throws UOE. Requesting the failure reason from a Jobby implementation that does not override getErrorMessage() produces this error instead of a message.","triggerScenarios":"Calling getErrorMessage() on a Jobby whose class has not overridden it — typically when a job failed and the error-reporting code tries to collect its failure message.","commonSituations":"HadoopDruidIndexerJob failure reporting aggregating error messages across nested jobs; custom Jobby extensions lacking the override.","solutions":["Override getErrorMessage() in the Jobby implementation to return the failure reason (or null).","Only call getErrorMessage() on implementations that support it.","Guard the call with try-catch for UOE and fall back to a generic message."],"exampleFix":"// before\nclass MyJob implements Jobby { /* no getErrorMessage */ }\n// after\n@Override\n@Nullable\npublic String getErrorMessage() { return lastError; }","handlingStrategy":"try-catch","validationCode":"if (!(job instanceof ErrorReportingJobby)) { return null; }","typeGuard":"boolean supportsErrorMessage(Object job) { try { job.getClass().getMethod(\"getErrorMessage\"); return true; } catch (NoSuchMethodException e) { return false; } }","tryCatchPattern":"try { msg = job.getErrorMessage(); } catch (UOE e) { log.warn(\"Error message unsupported for {}: {}\", job.getClass(), e.getMessage()); msg = \"unknown failure\"; }","preventionTips":["Override getErrorMessage() in custom Jobby implementations","Treat error messages as optional in failure-reporting code","Fall back to the job's generic failed state when messages are unsupported"],"tags":["unsupported-operation","hadoop-indexer","interface-default"],"backgroundTag":"method-not-implemented","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}