Class DataSourceStatusProvider.ErrorInfo

java.lang.Object
com.launchdarkly.sdk.server.interfaces.DataSourceStatusProvider.ErrorInfo
Enclosing interface:
DataSourceStatusProvider

public static final class DataSourceStatusProvider.ErrorInfo
extends java.lang.Object
A description of an error condition that the data source encountered.
See Also:
DataSourceStatusProvider.Status.getLastError()
  • Constructor Details

    • ErrorInfo

      public ErrorInfo​(DataSourceStatusProvider.ErrorKind kind, int statusCode, java.lang.String message, java.time.Instant time)
      Constructs an instance.
      Parameters:
      kind - the general category of the error
      statusCode - an HTTP status or zero
      message - an error message if applicable, or null
      time - the error timestamp
  • Method Details

    • fromException

      public static DataSourceStatusProvider.ErrorInfo fromException​(DataSourceStatusProvider.ErrorKind kind, java.lang.Throwable t)
      Constructs an instance based on an exception.
      Parameters:
      kind - the general category of the error
      t - the exception
      Returns:
      an ErrorInfo
    • fromHttpError

      public static DataSourceStatusProvider.ErrorInfo fromHttpError​(int statusCode)
      Constructs an instance based on an HTTP error status.
      Parameters:
      statusCode - the status code
      Returns:
      an ErrorInfo
    • getKind

      Returns an enumerated value representing the general category of the error.
      Returns:
      the general category of the error
    • getStatusCode

      public int getStatusCode()
      Returns the HTTP status code if the error was DataSourceStatusProvider.ErrorKind.ERROR_RESPONSE, or zero otherwise.
      Returns:
      an HTTP status or zero
    • getMessage

      public java.lang.String getMessage()
      Returns any additional human-readable information relevant to the error. The format of this message is subject to change and should not be relied on programmatically.
      Returns:
      an error message if applicable, or null
    • getTime

      public java.time.Instant getTime()
      Returns the date/time that the error occurred.
      Returns:
      the error timestamp
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object