{"record":{"id":"3a253da433125a73","repo":"pentaho/pentaho-kettle","slug":"e-getmessage-first-conversion-cause-no-own-message","errorCode":null,"errorMessage":"e.getMessage() (first conversion cause, no own message)","messagePattern":"e\\.getMessage\\(\\) \\(first conversion cause, no own message\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/csvinput/CsvInput.java","lineNumber":182,"sourceCode":"      if ( getStepMeta().isDoingErrorHandling() ) {\n        StringBuilder errorDescriptions = new StringBuilder( 100 );\n        StringBuilder errorFields = new StringBuilder( 50 );\n        for ( int i = 0; i < e.getCauses().size(); i++ ) {\n          if ( i > 0 ) {\n            errorDescriptions.append( \", \" );\n            errorFields.append( \", \" );\n          }\n          errorDescriptions.append( e.getCauses().get( i ).getMessage() );\n          errorFields.append( e.getFields().get( i ).toStringMeta() );\n        }\n\n        putError(\n          data.outputRowMeta, e.getRowData(), e.getCauses().size(), errorDescriptions.toString(), errorFields\n            .toString(), \"CSVINPUT001\" );\n      } else {\n        // Only forward the first cause.\n        //\n        throw new KettleException( e.getMessage(), e.getCauses().get( 0 ) );\n      }\n    }\n\n    return true;\n  }\n\n  private void prepareToRunInParallel() throws KettleException {\n    try {\n      // At this point it doesn't matter if we have 1 or more files.\n      // We'll use the same algorithm...\n      //\n      for ( String filename : data.filenames ) {\n        long size = KettleVFS.getInstance( getTransMeta().getBowl() )\n          .getFileObject( filename, getTransMeta() ).getContent().getSize();\n        data.fileSizes.add( size );\n        data.totalFileSize += size;\n      }\n","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/csvinput/CsvInput.java#L164-L200","documentation":"When the CSV input step's KettleCSVException carries multiple causes, processRow normally reports them via putError; if error handling is not enabled (or only-forward mode), it rethrows a KettleException with e.getMessage() and only the FIRST cause, dropping the rest.","triggerScenarios":"processRow hits a row-level parsing/conversion failure while error handling (putError) is unavailable, e.g. during unit-style invocations like testFileIsReleasedAfterProcessing.","commonSituations":"Malformed CSV rows with mixed type failures, running the step in tests without an error-handling row set, files with inconsistent column types.","solutions":["Look at e.getCauses().get(0) (the chained cause) for the first concrete failure","Enable the step's error handling so all causes are captured via putError instead of thrown","Fix the data or field formats causing the parse failures","If several rows are bad, run with error-handling to collect the full list"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate a sample CSV row against declared field formats\nfor (int i = 0; i < fields.length; i++)\n  fields[i].meta.convertData(fields[i].meta, sample[i]); // throws early","typeGuard":null,"tryCatchPattern":"try { processRow(...); }\ncatch (KettleException e) { logError(\"First CSV failure: \" + e.getCause().getMessage(), e.getCause()); }","preventionTips":["Enable step error handling to capture all causes via putError","Fix the first bad row revealed by the cause, then re-run to find others","Preview data and validate field formats before full runs"],"tags":["pdi","csv","error-handling"],"backgroundTag":"json-parse-error","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"}