{"record":{"id":"f015b56cd155c77d","repo":"apache/seatunnel","slug":"unknown-format-type","errorCode":null,"errorMessage":"Unknown format type: ","messagePattern":"Unknown format type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/config/DataFormatType.java","lineNumber":42,"sourceCode":"@Getter\npublic enum DataFormatType implements Serializable {\n    MAP(\"map\"),\n    STRING(\"string\"),\n    KV(\"kv\");\n\n    private final String format;\n\n    DataFormatType(String format) {\n        this.format = format;\n    }\n\n    public static DataFormatType fromString(String format) {\n        for (DataFormatType type : DataFormatType.values()) {\n            if (type.format.equalsIgnoreCase(format)) {\n                return type;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown format type: \" + format);\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":45,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/config/DataFormatType.java#L24-L45","documentation":"DataFormatType.fromString maps a user-supplied format string (e.g. json, string) to the DataFormatType enum by case-insensitive comparison; if no enum constant matches it throws IllegalArgumentException 'Unknown format type: <format>'. It guards the aerospike connector against misspelled format config values.","triggerScenarios":"Setting the aerospike source/sink 'format' option to a value not in the enum (anything other than the supported JSON/STRING values), which is then passed to DataFormatType.fromString.","commonSituations":"Typo like 'JSON ' with whitespace, 'jsonline', 'csv', or a format copied from another connector's docs; case is tolerated but spelling is not.","solutions":["Check the configured format value and correct it to a supported one (json or string, per DataFormatType)","Trim whitespace from the config value","Consult the aerospike connector docs for the allowed format options","Add a new enum constant + parsing branch if a new format is genuinely needed"],"exampleFix":"// before\nformat = csv\n// after\nformat = json","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"json\", \"string\");\nif (!allowed.contains(format.trim().toLowerCase())) throw new IllegalArgumentException(\"format must be one of \" + allowed);","typeGuard":"boolean isValidFormat(String f) { return f != null && (\"json\".equalsIgnoreCase(f.trim()) || \"string\".equalsIgnoreCase(f.trim())); }","tryCatchPattern":"try { type = DataFormatType.fromString(format); } catch (IllegalArgumentException e) { /* default to JSON or surface a clear config error */ type = DataFormatType.JSON; }","preventionTips":["Copy format values exactly from the aerospike connector docs","Trim whitespace from config values","Add a config pre-check in CI for allowed enum values","Prefer lowercase canonical values even though comparison is case-insensitive"],"tags":["aerospike","enum","config","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}