Exception: DilisensePepClient::NetworkError

Inherits:
Error
  • Object
show all
Defined in:
lib/dilisense_pep_client/errors.rb

Overview

Raised when there’s a network problem (timeout, connection failure, etc.) These errors are usually retryable after a delay

Examples:

Network timeout

begin
  results = client.check_individual(names: "Test")
rescue DilisensePepClient::NetworkError => e
  puts "Network problem: #{e.message}"
  # Usually safe to retry after a delay
end

Direct Known Subclasses

TimeoutError

Instance Attribute Summary

Attributes inherited from Error

#context, #error_code, #request_id, #timestamp

Instance Method Summary collapse

Methods inherited from Error

#security_event?, #to_h

Constructor Details

#initialize(message, network_error: nil, **options) ⇒ NetworkError

Returns a new instance of NetworkError.



194
195
196
197
198
199
200
201
# File 'lib/dilisense_pep_client/errors.rb', line 194

def initialize(message, network_error: nil, **options)
  context = {
    network_error_class: network_error&.class&.name,
    network_error_message: network_error&.message
  }.merge(options.fetch(:context, {}))
  
  super(message, error_code: "NETWORK_ERROR", context: context, **options)
end

Instance Method Details

#retryable?Boolean

Returns:

  • (Boolean)


203
204
205
# File 'lib/dilisense_pep_client/errors.rb', line 203

def retryable?
  true
end