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.



262
263
264
265
266
267
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 262

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

Instance Attribute Details

#kind ⇒ Symbol (readonly)

Returns the general category of the error.

Returns:

  • (Symbol) —

    the general category of the error



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

def kind
  @kind
end

#message ⇒ String? (readonly)

Returns message an error message if applicable, or nil.

Returns:

  • (String, nil) —

    message an error message if applicable, or nil



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

def message
  @message
end

#status_code ⇒ Integer (readonly)

Returns an HTTP status or zero.

Returns:

  • (Integer) —

    an HTTP status or zero



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

def status_code
  @status_code
end

#time ⇒ Time (readonly)

Returns time the error timestamp.

Returns:

  • (Time) —

    time the error timestamp



260
261
262
# File 'lib/ldclient-rb/interfaces/data_source.rb', line 260

def time
  @time
end