{"record":{"id":"353490616c5b00d6","repo":"pentaho/pentaho-kettle","slug":"exception-handler","errorCode":null,"errorMessage":"EXCEPTION: {handler}","messagePattern":"EXCEPTION: (.+?)","errorType":"exception","errorClass":"FunctorException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/util/PluginPropertyHandler.java","lineNumber":52,"sourceCode":"   * @author <a href=\"mailto:thomas.hoedl@aschauer-edv.at\">Thomas Hoedl(asc042)</a>\n   *\n   */\n  public abstract static class AbstractHandler implements Closure {\n    /**\n     * {@inheritDoc}\n     *\n     * @see org.apache.commons.collections.Closure#execute(java.lang.Object)\n     * @throws IllegalArgumentException\n     *           if property is null.\n     * @throws FunctorException\n     *           if KettleException in handle thrown.\n     */\n    public final void execute( final Object property ) throws IllegalArgumentException, FunctorException {\n      Assert.assertNotNull( property, \"Plugin property cannot be null\" );\n      try {\n        this.handle( (PluginProperty) property );\n      } catch ( KettleException e ) {\n        throw new FunctorException( \"EXCEPTION: \" + this, e );\n      }\n    }\n\n    /**\n     * Handle property.\n     *\n     * @param property\n     *          property.\n     * @throws KettleException\n     *           ...\n     */\n    protected abstract void handle( final PluginProperty property ) throws KettleException;\n  }\n\n  /**\n   * @author <a href=\"mailto:thomas.hoedl@aschauer-edv.at\">Thomas Hoedl(asc042)</a>\n   *\n   *         Fail/throws KettleException.","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/util/PluginPropertyHandler.java#L34-L70","documentation":"PluginPropertyHandler.Functor.execute wraps any KettleException thrown while handling a PluginProperty into a FunctorException with the message \"EXCEPTION: \" + this (the functor's toString). It is a generic adapter exception signaling that a property load/save functor failed; the original KettleException is attached as the cause.","triggerScenarios":"Any Functor (e.g. LoadXml, SaveXml, or Fail) whose handle(property) throws a KettleException during execute() — typically XML parsing/writing failures on a plugin property.","commonSituations":"Loading plugin settings from corrupt or malformed XML; saving properties to an unwritable stream; invoking the Fail sentinel functor in tests.","solutions":["Inspect getCause() for the underlying KettleException and fix that root problem first.","Ensure the property's XML source is well-formed before running the functor.","Verify output streams/paths are writable when saving properties.","Catch FunctorException around functor execution and handle or log the cause."],"exampleFix":"// before\nfunctor.execute(property);\n// after\ntry {\n  functor.execute(property);\n} catch (FunctorException e) {\n  logger.error(\"Property handling failed\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"if (property == null) {\n  throw new IllegalArgumentException(\"Property must not be null\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  functor.execute(property);\n} catch (FunctorException e) {\n  Throwable root = e.getCause(); // the real KettleException\n  log.error(\"Plugin property handling failed: \" + (root != null ? root.getMessage() : e.getMessage()), root);\n}","preventionTips":["Always inspect getCause() — FunctorException only wraps the real error","Validate property XML inputs before running load functors","Ensure output targets are writable before save functors"],"tags":["functor-exception","wrapped-exception","plugin-property"],"backgroundTag":"api-error-response","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"}