{"record":{"id":"b6ac40c4e96fe997","repo":"apache/dolphinscheduler","slug":"not-support-showtype-s-in-defaulthtmltemplate","errorCode":null,"errorMessage":"not support showType: %s in DefaultHTMLTemplate","messagePattern":"not support showType: (.+?) in DefaultHTMLTemplate","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/template/DefaultHTMLTemplate.java","lineNumber":57,"sourceCode":"import org.springframework.boot.configurationprocessor.json.JSONTokener;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.node.ArrayNode;\nimport com.fasterxml.jackson.databind.node.ObjectNode;\n\n@Slf4j\npublic class DefaultHTMLTemplate implements AlertTemplate {\n\n    @Override\n    public String getMessageFromTemplate(String content, ShowType showType, boolean showAll) {\n\n        switch (showType) {\n            case TABLE:\n                return getTableTypeMessage(content, showAll);\n            case TEXT:\n                return getTextTypeMessage(content);\n            default:\n                throw new IllegalArgumentException(\n                        String.format(\"not support showType: %s in DefaultHTMLTemplate\", showType));\n        }\n    }\n\n    /**\n     * get alert message which type is TABLE\n     *\n     * @param content message content\n     * @param showAll weather to show all\n     * @return alert message\n     */\n    private String getTableTypeMessage(String content, boolean showAll) {\n\n        if (StringUtils.isNotEmpty(content)) {\n            List<LinkedHashMap> mapItemsList = JSONUtils.toList(content, LinkedHashMap.class);\n\n            if (!showAll && mapItemsList.size() > EmailConstants.NUMBER_1000) {\n                mapItemsList = mapItemsList.subList(0, EmailConstants.NUMBER_1000);","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/template/DefaultHTMLTemplate.java#L39-L75","documentation":"Fires in DefaultHTMLTemplate.getMessageFromTemplate when the alert content's showType is neither TABLE nor TEXT. It means the alert JSON contained an unsupported showType value, so no HTML rendering strategy exists for it; the template aborts instead of producing malformed alert HTML.","triggerScenarios":"An alert is rendered with a showType string other than 'TABLE' or 'TEXT' (case-sensitive), or showType is null/missing from the alert content.","commonSituations":"Typo in showType ('table' lowercase) in task alert output parameters; a custom task emits an unsupported showType like 'ATTACHMENT' or 'MARKDOWN' that the default HTML template cannot render.","solutions":["Set showType to 'TABLE' or 'TEXT' (uppercase) in the task/alert output configuration.","If a different rendering style is needed, implement a custom HTMLTemplate and register it instead of DefaultHTMLTemplate.","Log/print the incoming showType to find which component emits the bad value."],"exampleFix":"// before\nshowType=table\n// after\nshowType=TABLE","handlingStrategy":"validation","validationCode":"String showType = ...;\nif (!\"TABLE\".equals(showType) && !\"TEXT\".equals(showType)) throw new IllegalArgumentException(\"unsupported showType: \" + showType);","typeGuard":null,"tryCatchPattern":"try { template.getMessageFromTemplate(content, showType, showAll); } catch (IllegalArgumentException e) { log.error(\"bad showType\", e); }","preventionTips":["Use exact uppercase TABLE/TEXT values","Check showType emitted by custom tasks","Fall back to TEXT template for unknown show types"],"tags":["alert","template","invalid-enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}