Class TextWritingException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TextWritingException
    extends AbstractException
    Exception type used provide information about any issue that might happen while writing to a given output.

    It generally provides location and data information in case of a writing failure.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        TextWritingException​(java.lang.String message)
      Creates a new exception with information about an error that occurred when writing data to some output.
        TextWritingException​(java.lang.String message, long line, java.lang.Object[] row)
      Creates a new exception with information about an error that occurred when writing data to some output.
      private TextWritingException​(java.lang.String message, long recordCount, java.lang.Object[] row, java.lang.String recordCharacters, java.lang.Throwable cause)
      Creates a new exception with information about an error that occurred when writing data to some output.
        TextWritingException​(java.lang.String message, long recordCount, java.lang.Object[] row, java.lang.Throwable cause)
      Creates a new exception with information about an error that occurred when writing data to some output.
        TextWritingException​(java.lang.String message, long line, java.lang.String recordCharacters)
      Creates a new exception with information about an error that occurred when writing data to some output.
        TextWritingException​(java.lang.String message, long recordCount, java.lang.String recordCharacters, java.lang.Throwable cause)
      Creates a new exception with information about an error that occurred when writing data to some output.
        TextWritingException​(java.lang.Throwable cause)
      Creates a new exception with information about an error that occurred when writing data to some output.
    • Field Detail

      • recordCount

        private final long recordCount
      • recordData

        private final java.lang.Object[] recordData
      • recordCharacters

        private final java.lang.String recordCharacters
    • Constructor Detail

      • TextWritingException

        private TextWritingException​(java.lang.String message,
                                     long recordCount,
                                     java.lang.Object[] row,
                                     java.lang.String recordCharacters,
                                     java.lang.Throwable cause)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
        recordCount - the number of records written until the error occurred
        row - the input row that was being written when the error occurred
        recordCharacters - the characters already written to the output record.
        cause - the cause of the error
      • TextWritingException

        public TextWritingException​(java.lang.String message,
                                    long recordCount,
                                    java.lang.String recordCharacters,
                                    java.lang.Throwable cause)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
        recordCount - the number of records written until the error occurred
        recordCharacters - the characters already written to the output record.
        cause - the cause of the error
      • TextWritingException

        public TextWritingException​(java.lang.String message,
                                    long recordCount,
                                    java.lang.Object[] row,
                                    java.lang.Throwable cause)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
        recordCount - the number of records written until the error occurred
        row - the input row that was being written when the error occurred
        cause - the cause of the error
      • TextWritingException

        public TextWritingException​(java.lang.String message)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
      • TextWritingException

        public TextWritingException​(java.lang.Throwable cause)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        cause - the cause of the error
      • TextWritingException

        public TextWritingException​(java.lang.String message,
                                    long line,
                                    java.lang.Object[] row)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
        line - index of the line being written to the output when the error occurred
        row - the input row that was being written when the error occurred
      • TextWritingException

        public TextWritingException​(java.lang.String message,
                                    long line,
                                    java.lang.String recordCharacters)
        Creates a new exception with information about an error that occurred when writing data to some output.
        Parameters:
        message - message with details about the error
        line - index of the line being written to the output when the error occurred
        recordCharacters - the characters already written to the output record.
    • Method Detail

      • getRecordCount

        public long getRecordCount()
        Returns the number of records written before the exception occurred.
        Returns:
        the number of records written before the exception occurred.
      • getRecordData

        public java.lang.Object[] getRecordData()
        Returns the data that failed to be written
        Returns:
        the data that failed to be written
      • getRecordCharacters

        public java.lang.String getRecordCharacters()
        Returns the character data that failed to be written
        Returns:
        the character data that failed to be written
      • getErrorDescription

        protected java.lang.String getErrorDescription()
        Description copied from class: AbstractException
        Returns a generic description of the error. The result of this method is used by AbstractException.getMessage() to print out a general description of the error before a detailed message of the root cause.
        Specified by:
        getErrorDescription in class AbstractException
        Returns:
        a generic description of the error.