OtterMind/Chat2DB · warning · ParamBusinessException

common.paramDetailError

common.paramDetailError

Error message

common.paramDetailError

What it means

ParamBusinessException ('common.paramDetailError') from ImportFactory.get when the requested import type (lowercased) is not one of xls, xlsx, csv, json, sql — no IImportStrategy is registered.

Source

Thrown at chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/task/imports/ImportFactory.java:26

import ai.chat2db.community.domain.core.impl.task.imports.sql.SQLImporter;

import java.util.Map;
import java.util.Objects;

public class ImportFactory {

    private static final Map<String, IImportStrategy> exports = Map.of(
            "xls", new XLSImporter(),
            "xlsx", new XLSXImporter(),
            "csv", new CSVImporter(),
            "json", new JSONImporter(),
            "sql", new SQLImporter()
    );

    public static IImportStrategy get(String type) {
        IImportStrategy dataExportStrategy = exports.get(type.toLowerCase());
        if (Objects.isNull(dataExportStrategy)) {
            throw new ParamBusinessException(type);
        }
        return dataExportStrategy;
    }
}

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Use one of the supported import types: xls, xlsx, csv, json, sql.
  2. If a new format is required, implement IImportStrategy and add it to the exports map in ImportFactory.
  3. Validate the type against the supported set before calling get.

Example fix

// before
IImportStrategy s = ImportFactory.get("xml"); // throws
// after
IImportStrategy s = ImportFactory.get("sql");
Defensive patterns

Strategy: type-guard

Validate before calling

java.util.Set<String> supported = java.util.Set.of("xls","xlsx","csv","json","sql");
if (type == null || !supported.contains(type.toLowerCase())) throw new ParamBusinessException(type);

Type guard

boolean isSupportedImportType(String t) {
    return t != null && java.util.Set.of("xls","xlsx","csv","json","sql").contains(t.toLowerCase());
}

Prevention

When it happens

Trigger: Calling ImportFactory.get with an unsupported/typo'd type string, or a format the importer set does not cover.

Common situations: Client selects a format not supported for import; typo in the type field; new format needed without a registered importer.

Related errors


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/213cd598c8e8987f. Report an issue: GitHub.