Class CsvException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.opencsv.exceptions.CsvException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CsvChainedException, CsvFieldAssignmentException

public class CsvException extends Exception
This is the base class for all exceptions for opencsv.
Since:
3.8
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • lineNumber

      private long lineNumber
    • line

      private String[] line
  • Constructor Details

    • CsvException

      public CsvException()
      Default constructor, in case no parameters are required.
    • CsvException

      public CsvException(String message)
      Constructor that allows a human-readable message.
      Parameters:
      message - The error text
  • Method Details

    • getLineNumber

      public long getLineNumber()
      Returns:
      The line number that caused the error. This should be the one-based number of the line that caused the error, not including the header line, if present.
    • setLineNumber

      public void setLineNumber(long lineNumber)
      Parameters:
      lineNumber - The line number that caused the error. This should be the one-based number of the line that caused the error, not including the header line, if present.
    • getLine

      public String[] getLine()
      Returns:
      The line that caused the error if reading and the data are available. Is always null on errors during writing, and may also be null or empty on certain errors that occur during reading.
      Since:
      4.4
    • setLine

      public void setLine(String[] line)
      Parameters:
      line - The line that caused the error on reading. May be null.
      Since:
      4.4