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

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/interfaces/data_source.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.



256
257
258
259
260
261
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 256

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



248
249
250
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 248

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



252
253
254
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 252

def message
  @message
end

#status_codeInteger (readonly)

Returns an HTTP status or zero.

Returns:

  • (Integer)

    an HTTP status or zero



250
251
252
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 250

def status_code
  @status_code
end

#timeTime (readonly)

Returns time the error timestamp.

Returns:

  • (Time)

    time the error timestamp



254
255
256
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 254

def time
  @time
end