Interface DataExceptionContributor

All Known Implementing Classes:
AbstractFieldMapping, AbstractPipeline, AddFieldsAction, AggregateGroupFieldsAction, AmazonS3File, AmazonS3FileSink, AmazonS3FileSource, Attributes, AvroPipelineInput, AvroPipelineOutput, Bean, BinaryFieldDef, BloombergMessage, BooleanFieldDef, CalculatedField, Column, CompositePipelineAction, ConvertDateTimeToStringAction, ConvertNullToValueAction, ConvertNumberToStringAction, ConvertStringToBooleanAction, ConvertStringToDateTimeAction, ConvertStringToNumberAction, ConvertValueToStringAction, CopyFieldsAction, CsvPipelineInput, CsvPipelineOutput, DataMapping, DataMappingAction, DataMappingObject, DataMappingPart, DataMappingPipeline, DataMappingProblem, DataMappingResult, DataReaderPipelineInput, Dataset, DatasetPipelineInput, DataWriterPipelineOutput, DateTimePattern, DateTimePatternMatch, DecisionTable, DecisionTableAction, DecisionTableCondition, DecisionTableObject, DecisionTableOutcome, DecisionTableResult, DecisionTableRule, DecisionTree, DecisionTreeAction, DecisionTreeNode, DecisionTreeObject, DecisionTreeOutcome, DecisionTreeResult, Diff, EntityDef, EntityDefDiff, EntityRelationshipDef, EntityRelationshipDefDiff, ExcelPipelineInput, ExcelPipelineOutput, FieldDef, FieldDefDiff, FieldMapping, FileSinkPipelineOutput, FileSourcePipelineInput, FilterFieldExistsAction, FilterFieldMatchesPatternAction, FilterFieldNotNullAction, FilterMatchExpression, FixedWidthPipelineInput, FixedWidthPipelineOutput, FoundationObject, IndexDef, IndexDefDiff, IndexFieldDef, IndexFieldDefDiff, JdbcConnection, JdbcDataset, JdbcExportedKey, JdbcFieldIndex, JdbcImportedKey, JdbcIndex, JdbcPipelineInput, JdbcPipelineOutput, JdbcQuery, JdbcQueryColumn, JdbcQueryParameter, JdbcSchema, JdbcTable, JdbcTableColumn, JiraIssue, JiraSearch, JsonPipelineInput, JsonRecordPipelineInput, JsonRecordPipelineOutput, LatexPipelineOutput, LocalFile, LocalFileDataset, LocalFileSink, LocalFileSource, MemoryDataset, MicrosoftWordPipelineOutput, MvStoreDataset, NullPipeline, NumberDescriptor, NumberMatch, NumericFieldDef, OpenFinancialExchangePipelineInput, OrcPipelineInput, OrcPipelineOutput, ParquetPipelineInput, ParquetPipelineOutput, PdfPipelineInput, PdfPipelineOutput, Pipeline, PipelineAction, PipelineInput, PipelineObject, PipelineOutput, PoiSxssfProvider, PoiXssfbProvider, PoiXssfSaxProvider, Property, PropertyDiff, ProxyPipelineInput, ProxyPipelineOutput, RecordDiff, RecordFieldDef, RemoveDuplicatesAction, RenameFieldsAction, SchemaDef, SchemaDefDiff, SchemaObject, SchemaPart, SchemaProblem, SchemaValidationPath, SelectArrangeFieldsAction, ShopifyCustomerCriteria, ShopifyEventCriteria, ShopifyInventoryItem, ShopifyInventoryItemCriteria, ShopifyInventoryLevelCriteria, ShopifyOrder, ShopifyProductCriteria, ShopifyShippingAddress, SortFieldsAction, Tags, TemporalFieldDef, TextFieldDef, Tree, TreeNode, UuidFieldDef, ValidateFieldsExistsAction, ValidateFieldsMatchPatternAction, ValidateFieldsNotNullAction, ValidateMatchExpression, ValidationMessage, ValidationResult, XmlPipelineInput, XmlRecordPipelineInput, XmlRecordPipelineOutput

public interface DataExceptionContributor
An interface for classes capable of adding context/information to exceptions usually to aid in identifying and troubleshooting issues.
  • Method Details

    • addExceptionProperties

      default DataException addExceptionProperties(DataException exception)
      Adds this object's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
    • addExceptionProperties

      default DataException addExceptionProperties(DataException exception, String namePrefix)
      Adds this object's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.

      Use namePrefix as the beginning of property keys: exception.set(namePrefix + ".fileType", fileType);

    • exception

      default DataException exception(String message, Throwable exception)
      Converts an exception to a DataException, prefixing the original message with the specified text and adding this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.

      If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be nested inside a DataException. In either case the result message will contain the new prefix along with this endpoint properties.

    • exception

      default DataException exception(Throwable exception)
      Converts an exception to a DataException and adds this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.

      If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be nested inside a DataException. In either case the result message will contain this endpoint properties.

    • exception

      default DataException exception(String message)
      Creates an exception with the specified message and containing this endpoint's properties (name-value pairs).

      The returned exception can then be thrown in the normal way.

    • contributeExceptionProperties

      static DataException contributeExceptionProperties(Throwable e, DataExceptionContributor... contributors)
      A utility method to add properties from a list of DataExceptionContributor to the supplied exception.
    • contributeExceptionProperties

      static DataException contributeExceptionProperties(Throwable e, String namePrefix, DataExceptionContributor... contributors)
      A utility method to add properties from a list of DataExceptionContributor to the supplied exception with the given name prefix.