appsmithorg/appsmith · error · AppsmithPluginException
PE-ARG-5000
PE-ARG-5000
Error message
Unsupported feature: ${feature} What it means
Thrown by AiFeatureServiceFactory.getAiFeatureService when the Feature enum switch has no matching case. The switch covers TEXT_GENERATE, TEXT_CLASSIFY, TEXT_SUMMARY, TEXT_ENTITY_EXTRACT, IMAGE_CLASSIFY, IMAGE_ENTITY_EXTRACT, IMAGE_CAPTION; any other value (or a future enum constant added without a case) hits the default throw. Code PE-ARG-5000.
Source
Thrown at app/server/appsmith-plugins/appsmithAiPlugin/src/main/java/com/external/plugins/services/AiFeatureServiceFactory.java:39
return new TextClassificationServiceImpl();
}
case TEXT_SUMMARY -> {
return new TextSummarizationServiceImpl();
}
case TEXT_ENTITY_EXTRACT -> {
return new TextEntityExtractionServiceImpl();
}
case IMAGE_CLASSIFY -> {
return new ImageClassificationServiceImpl();
}
case IMAGE_ENTITY_EXTRACT -> {
return new ImageEntityExtractionServiceImpl();
}
case IMAGE_CAPTION -> {
return new ImageCaptioningServiceImpl();
}
}
throw new AppsmithPluginException(
AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, "Unsupported feature: " + feature);
}
}
View on GitHub (pinned to 8cd9021c24)
Solutions
- Confirm the requested Feature is one of the seven supported values.
- If you added a new Feature enum constant, add a corresponding case to the factory switch.
- Validate the feature value against the supported set before calling the factory.
Example fix
// before: factory has no case for the new constant
// case UNSENT_FEATURE -> ...
// after: add the case
switch (feature) {
// ...existing cases...
case NEW_FEATURE -> { return new NewFeatureServiceImpl(); }
} Defensive patterns
Strategy: validation
Validate before calling
// Confirm feature is supported before invoking the factory
Set<Feature> supported = EnumSet.of(
Feature.TEXT_GENERATE, Feature.TEXT_CLASSIFY, Feature.TEXT_SUMMARY,
Feature.TEXT_ENTITY_EXTRACT, Feature.IMAGE_CLASSIFY,
Feature.IMAGE_ENTITY_EXTRACT, Feature.IMAGE_CAPTION);
if (!supported.contains(feature)) {
return errorResult("Unsupported feature: " + feature);
} Type guard
boolean isSupportedFeature(Feature f) {
return switch (f) {
case TEXT_GENERATE, TEXT_CLASSIFY, TEXT_SUMMARY, TEXT_ENTITY_EXTRACT,
IMAGE_CLASSIFY, IMAGE_ENTITY_EXTRACT, IMAGE_CAPTION -> true;
default -> false;
};
} Try / catch
try {
AiFeatureService svc = AiFeatureServiceFactory.getAiFeatureService(feature);
} catch (AppsmithPluginException e) {
if (e.getMessage().startsWith("Unsupported feature")) {
// surface supported feature list to the user
}
} Prevention
- When adding a Feature enum constant, update the factory switch in the same change.
- Expose the supported feature set to the UI so users cannot select unmapped values.
- Validate feature against the supported set before calling the factory.
When it happens
Trigger: Calling getAiFeatureService with a Feature value not handled by the switch — e.g. null (would NPE in switch instead), or a newly added enum constant the factory wasn't updated to support.
Common situations: A new Feature variant is introduced in the enum but the factory switch is not updated; a caller passes an unexpected/custom feature; deserialization yields an unmapped feature value.
Related errors
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/caa82bbc0142ea63.
Report an issue: GitHub.