{"record":{"id":"9e74f7c01cea303c","repo":"pentaho/pentaho-kettle","slug":"forced-exception","errorCode":null,"errorMessage":"Forced exception","messagePattern":"Forced exception","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"warning","filePath":"engine/src/main/java/org/pentaho/di/core/util/PluginPropertyHandler.java","lineNumber":86,"sourceCode":"   * @author <a href=\"mailto:thomas.hoedl@aschauer-edv.at\">Thomas Hoedl(asc042)</a>\n   *\n   *         Fail/throws KettleException.\n   */\n  public static class Fail extends AbstractHandler {\n\n    /**\n     * The message.\n     */\n    public static final String MESSAGE = \"Forced exception\";\n\n    /**\n     * The instance.\n     */\n    public static final Fail INSTANCE = new Fail();\n\n    @Override\n    protected void handle( final PluginProperty property ) throws KettleException {\n      throw new KettleException( MESSAGE );\n    }\n\n  }\n\n  /**\n   * @author <a href=\"mailto:thomas.hoedl@aschauer-edv.at\">Thomas Hoedl(asc042)</a>\n   *\n   */\n  public static class AppendXml extends AbstractHandler {\n\n    private final StringBuilder builder = new StringBuilder();\n\n    @Override\n    protected void handle( final PluginProperty property ) {\n      property.appendXml( this.builder );\n    }\n\n    /**","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/util/PluginPropertyHandler.java#L68-L104","documentation":"PluginPropertyHandler.Fail is a static sentinel functor whose handle() unconditionally throws a KettleException with the constant MESSAGE \"Forced exception\". It is a no-op/test placeholder for handlers that must never be invoked; reaching it means code called the Fail instance where a real handler was expected.","triggerScenarios":"Explicitly executing PluginPropertyHandler.Fail.INSTANCE against a property, or wiring Fail as a default handler that is then actually invoked.","commonSituations":"Unit tests exercising exception propagation through Functor.execute; accidentally passing Fail.INSTANCE where a real load/save handler should have been configured.","solutions":["If intentional (test), expect and catch the resulting FunctorException/KettleException.","If unintentional, replace the Fail.INSTANCE handler with the real handler (e.g. LoadXml or SaveXml).","Check the handler selection/dispatch logic to see why the sentinel default was chosen."],"exampleFix":"// before\nPluginPropertyHandler handler = PluginPropertyHandler.Fail.INSTANCE;\nhandler.execute(property);\n// after\nPluginPropertyHandler handler = new PluginPropertyHandler.LoadXml(nodes);\nhandler.execute(property);","handlingStrategy":"validation","validationCode":"if (handler instanceof PluginPropertyHandler.Fail) {\n  throw new IllegalStateException(\"Fail sentinel handler selected; configure a real handler\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  handler.execute(property);\n} catch (FunctorException e) {\n  // Fail.INSTANCE always throws; treat as programming/configuration mistake\n}","preventionTips":["Never wire Fail.INSTANCE as a production default handler","Use Fail only in tests asserting exception propagation","Log the selected handler type during dispatch debugging"],"tags":["sentinel","forced-exception","test-placeholder"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}