public class TextWritingException extends AbstractException
It generally provides location and data information in case of a writing failure.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
recordCharacters |
private long |
recordCount |
private java.lang.Object[] |
recordData |
private static long |
serialVersionUID |
errorContentLength
Modifier | Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getDetails()
Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer.
|
protected java.lang.String |
getErrorDescription()
Returns a generic description of the error.
|
java.lang.String |
getRecordCharacters()
Returns the character data that failed to be written
|
long |
getRecordCount()
Returns the number of records written before the exception occurred.
|
java.lang.Object[] |
getRecordData()
Returns the data that failed to be written
|
getMessage, printIfNotEmpty, restrictContent, restrictContent, restrictContent, restrictContent, restrictContent, setErrorContentLength, updateMessage
private static final long serialVersionUID
private final long recordCount
private final java.lang.Object[] recordData
private final java.lang.String recordCharacters
private TextWritingException(java.lang.String message, long recordCount, java.lang.Object[] row, java.lang.String recordCharacters, java.lang.Throwable cause)
message
- message with details about the errorrecordCount
- the number of records written until the error occurredrow
- the input row that was being written when the error occurredrecordCharacters
- the characters already written to the output record.cause
- the cause of the errorpublic TextWritingException(java.lang.String message, long recordCount, java.lang.String recordCharacters, java.lang.Throwable cause)
message
- message with details about the errorrecordCount
- the number of records written until the error occurredrecordCharacters
- the characters already written to the output record.cause
- the cause of the errorpublic TextWritingException(java.lang.String message, long recordCount, java.lang.Object[] row, java.lang.Throwable cause)
message
- message with details about the errorrecordCount
- the number of records written until the error occurredrow
- the input row that was being written when the error occurredcause
- the cause of the errorpublic TextWritingException(java.lang.String message)
message
- message with details about the errorpublic TextWritingException(java.lang.Throwable cause)
cause
- the cause of the errorpublic TextWritingException(java.lang.String message, long line, java.lang.Object[] row)
message
- message with details about the errorline
- index of the line being written to the output when the error occurredrow
- the input row that was being written when the error occurredpublic TextWritingException(java.lang.String message, long line, java.lang.String recordCharacters)
message
- message with details about the errorline
- index of the line being written to the output when the error occurredrecordCharacters
- the characters already written to the output record.public long getRecordCount()
public java.lang.Object[] getRecordData()
public java.lang.String getRecordCharacters()
protected java.lang.String getDetails()
AbstractException
AbstractException.printIfNotEmpty(String, String, Object)
to create a comma-separated list of relevant properties and their (non null) values.
The result of this method is used by the AbstractException.getMessage()
method to print out these details after the error message.getDetails
in class AbstractException
protected java.lang.String getErrorDescription()
AbstractException
AbstractException.getMessage()
to print out a general description of the error before a detailed message of the root cause.getErrorDescription
in class AbstractException