Top Description Methods
com.univocity.parsers.common

public Interface ProcessorErrorHandler<T extends Context>

Known Direct Subinterfaces
com.univocity.parsers.common.RowProcessorErrorHandler
Known Direct Implementers
com.univocity.parsers.common.RetryableErrorHandler, com.univocity.parsers.common.NoopProcessorErrorHandler
Imports
com.univocity.parsers.common.processor.*, com.univocity.parsers.common.processor.core.*

The ProcessorErrorHandler is a callback used by the parser/writer to handle non-fatal DataProcessingExceptions that may occur when processing rows using a Processor or RowWriterProcessor. This leaves the responsibility of error handling to the user. If the user does not rethrow the DataProcessingException, the parsing/writing process won't stop and will proceed normally.

This error handler WILL NOT handle TextParsingExceptions or other errors that prevent the parser to reliably extract rows from a given input, or the writer to proceed writing data.

When parsing, the handleError(DataProcessingException, Object[], Context) method will be called only when a valid record has been parsed, but the subsequent processing executed by a Processor fails.

When writing, the handleError(DataProcessingException, Object[], Context) method will be called only when a using the AbstractWriter#processRecord(Object) methods, and RowWriterProcessor fails to execute.

Author
Univocity Software Pty Ltd - [email protected]
See Also
RowProcessor, RowWriterProcessor, DataProcessingException, TextParsingException, AbstractParser, AbstractWriter, CommonSettings, Context

Method Summary

Modifier and TypeMethod and Description
public void
handleError(DataProcessingException
the exception thrown during the processing an input record. Rethrow the error to abort the parsing process. When parsing, you can also invoke ParsingContext#stop() to stop the parser silently.
error
,
Object[]
the record that could not be processed. When writing, the original input object (i.e. null, java bean or object array) will be sent by the writer.
inputRow
,
T
the parsing context with information about the state of the parser at the time the error occurred. Will be null when writing.
context
)

Handles non-fatal instances of DataProcessingException that are thrown by a Processor while processing a record parsed from the input, or from a RowWriterProcessor when processing records for writing.

Method Detail

handleErrorback to summary
public void handleError(DataProcessingException error, Object[] inputRow, T context)

Handles non-fatal instances of DataProcessingException that are thrown by a Processor while processing a record parsed from the input, or from a RowWriterProcessor when processing records for writing.

Parameters
error:DataProcessingException

the exception thrown during the processing an input record. Rethrow the error to abort the parsing process. When parsing, you can also invoke ParsingContext#stop() to stop the parser silently.

inputRow:Object[]

the record that could not be processed. When writing, the original input object (i.e. null, java bean or object array) will be sent by the writer.

context:T

the parsing context with information about the state of the parser at the time the error occurred. Will be null when writing.