{"record":{"id":"5d4d981fc4f67519","repo":"pentaho/pentaho-kettle","slug":"exc-wraps-parse-exception-no-own-message","errorCode":null,"errorMessage":"exc (wraps parse exception, no own message)","messagePattern":"exc \\(wraps parse exception, no own message\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/common/CsvInputAwareHelper.java","lineNumber":192,"sourceCode":"   * @return the row value at the given index\n   */\n  default String getStringFromRow( final RowMetaInterface rowMeta, final Object[] row, final int index,\n                                   final boolean failOnParseError ) throws KettleException {\n    String string = null;\n    Exception exc = null;\n    try {\n      string = rowMeta.getString( row, index );\n    } catch ( final Exception e ) {\n      exc = e;\n    }\n\n    // if 'failOnParseError' is true, and we caught an exception, we either re-throw the exception, or wrap its as a\n    // KettleException, if it isn't one already\n    if ( failOnParseError ) {\n      if ( exc instanceof KettleException ) {\n        throw (KettleException) exc;\n      } else if ( exc != null ) {\n        throw new KettleException( exc );\n      }\n    }\n\n    // if 'failOnParseError' is false, or there is no exception otherwise, we get the string value straight from the row\n    // object\n    if ( string == null ) {\n      if ( ( row.length <= index ) && failOnParseError ) {\n        throw new KettleException( new NullPointerException() );\n      }\n      string = row.length <= index || row[ index ] == null ? null : row[ index ].toString();\n    }\n\n    return string;\n  }\n\n  /**\n   * Creates a buffered input stream reader for the given CSV input metadata and input stream.\n   *","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/common/CsvInputAwareHelper.java#L174-L210","documentation":"In CsvInputAwareHelper.getStringFromRow, when failOnParseError is true and a parsing exception (exc) was recorded earlier in the read, it is re-thrown as-is if already a KettleException, otherwise wrapped in new KettleException(exc). The visible message is just the wrapped exception's toString, since no own message is supplied.","triggerScenarios":"Reading a CSV row whose field fails to parse into the declared type (e.g. text field with invalid encoding or malformed number/date) while the text-file-input/CSV step has 'fail on parse error' enabled.","commonSituations":"Data file contains empty or malformed values in typed columns, wrong file encoding causing garbled bytes, schema changed upstream (column order/types).","solutions":["Inspect the wrapped cause for the underlying parse error and offending field","Correct the field's declared format/type in the step metadata to match the file","Fix the source file encoding or the bad record","If bad rows are expected, disable 'fail on parse error' and configure error handling to route them to an error stream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// sample the file and verify typed fields parse before running the full transformation\nString s = row.get(0); Integer.parseInt(s.trim()); // throws early on malformed data","typeGuard":null,"tryCatchPattern":"try { helper.getStringFromRow(row, index, failOnParseError); }\ncatch (KettleException e) { logError(\"CSV parse failed: \" + e.getCause(), e); routeToErrorStream(row, e); }","preventionTips":["Enable error handling instead of fail-on-parse-error for dirty data","Confirm file encoding matches the step setting","Preview rows in Spoon before full runs"],"tags":["pdi","csv","parse-error"],"backgroundTag":"invalid-argument-format","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"}