Class: LaunchDarkly::Interfaces::DataSource::ErrorInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/interfaces.rb

Overview

A description of an error condition that the data source encountered.

Constant Summary collapse

UNKNOWN =

An unexpected error, such as an uncaught exception, further described by #message.

:unknown
NETWORK_ERROR =

An I/O error such as a dropped connection.

:network_error
ERROR_RESPONSE =

The LaunchDarkly service returned an HTTP response with an error status, available with #status_code.

:error_response
INVALID_DATA =

The SDK received malformed data from the LaunchDarkly service.

:invalid_data
STORE_ERROR =

The data source itself is working, but when it tried to put an update into the data store, the data store failed (so the SDK may not have the latest data).

Data source implementations do not need to report this kind of error; it will be automatically reported by the SDK when exceptions are detected.

:store_error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, status_code, message, time) ⇒ ErrorInfo

Returns a new instance of ErrorInfo.



783
784
785
786
787
788
# File 'lib/ldclient-rb/interfaces.rb', line 783

def initialize(kind, status_code, message, time)
  @kind = kind
  @status_code = status_code
  @message = message
  @time = time
end

Instance Attribute Details

#kindSymbol (readonly)

Returns the general category of the error.

Returns:

  • (Symbol)

    the general category of the error



775
776
777
# File 'lib/ldclient-rb/interfaces.rb', line 775

def kind
  @kind
end

#messageString? (readonly)

Returns message an error message if applicable, or nil.

Returns:

  • (String, nil)

    message an error message if applicable, or nil



779
780
781
# File 'lib/ldclient-rb/interfaces.rb', line 779

def message
  @message
end

#status_codeInteger (readonly)

Returns an HTTP status or zero.

Returns:

  • (Integer)

    an HTTP status or zero



777
778
779
# File 'lib/ldclient-rb/interfaces.rb', line 777

def status_code
  @status_code
end

#timeTime (readonly)

Returns time the error timestamp.

Returns:

  • (Time)

    time the error timestamp



781
782
783
# File 'lib/ldclient-rb/interfaces.rb', line 781

def time
  @time
end