Interface CustomErrorContext

All Known Implementing Classes:
ChildErrorContext, EasyFileScanBuilder.EvfErrorContext, EmptyErrorContext, FileScanFramework.FileRowSetContext, FileSchemaNegotiatorImpl.SplitErrorContext

public interface CustomErrorContext
Generic mechanism to pass error context throughout the row set mechanism and scan framework. The idea is to encapsulate error context information in an object that can be passed around, rather than having to pass the error information directly. In many cases, the same mechanisms are called from multiple contexts, making it hard to generalize the information that would be required. By hiding that information in an error context, the caller decides what to add to the error, the intermediate classes just pass along this opaque context.

In some cases, such as file scans within a scan operator, there can be multiple levels of context. A format plugin, say, can describe the plugin and any interesting options. Then, a file scan can create a child context that adds things like file name, split offset, etc.

If this proves useful elsewhere, it can be moved into the same package as UserError, and a new addContext() method added to the UserException.Builder to make the error context easier to use.