com.univocity.api.data
Interface DataErrorHandler<T>

Type Parameters:
T - The type of the data returned in case of an error.

public interface DataErrorHandler<T>

The DataErrorHandler is a handler for errors that may occur when reading data from a query. In case of exceptions or unexpected data, it provides a way to handle and potentially recover from the error.

For example, if a query is configured to return a single row (i.e. through QueryResult.returnSingleRow(), but it actually produces 3 rows, handleUnexpectedData(Object[][]) can be used to return the first row.

Author:
uniVocity Software Pty Ltd - dev@univocity.com

Method Summary
 T handleException(Throwable t)
          Handles an exception that happened when executing a query.
 T handleUnexpectedData(Object[][] data)
          Handles unexpected data produced by a query.
 

Method Detail

handleException

T handleException(Throwable t)
Handles an exception that happened when executing a query.

Parameters:
t - the exception thrown while executing a query.
Returns:
an object with data if the handler recovered from the error.

handleUnexpectedData

T handleUnexpectedData(Object[][] data)
Handles unexpected data produced by a query.

Parameters:
data - the data produced by a query.
Returns:
an object with data if the handler recovered from the error.


Copyright © 2015 uniVocity Software Pty Ltd. All rights reserved.