Interface DataSourceAPIErrorDescriptor

  • All Known Implementing Classes:
    DataSourceAPIErrorDescriptorImpl

    public interface DataSourceAPIErrorDescriptor
    Defines how to handle an error from calls to the underlying data source. Note that the same error could be defined many time to allow different processing in different contexts. For example, "http-401" and "http-401-retry" - we might want to log an error only after retry failed.
    • Method Detail

      • getErrorId

        java.lang.String getErrorId()
        E.g. http-401
        Returns:
        non blank value
      • getErrorMessage

        java.lang.String getErrorMessage()
        The error message could be used for logging and/or system events. Its form is a String format, e.g. "Failed to fetch doc %s".
        Returns:
        null or blank is optional
      • isFatal

        boolean isFatal()
        Returns:
        true if this error should stop the scanner
      • getNumRetries

        int getNumRetries()
        The number of times to retry after a failure.
        Returns:
        A value < 0 to use the default number of retries
      • getPercentTimeoutIncreaseOnRetry

        int getPercentTimeoutIncreaseOnRetry()
        How much to increase the timeout period on each retry. For example, if 150% and timeout for the first attempt is 8 seconds: The timeout for the second attempt will be 12 seconds and for the third attempt will be 18 seconds.
        Returns:
        value >= 100 (100 means no change in timeout on subsequent attempts).
      • getSystemEventSevirity

        SystemEvent.Severity getSystemEventSevirity()
        Generate a system event with the specified severity. Use the text returned from getErrorMessage() as the event's text
        Returns:
        null if a system event should not be generated
      • getErrorProperties

        java.util.Properties getErrorProperties()
        Returns:
        additional error properties