Exception: MailCapture::NetworkError

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

Overview

Raised when the SDK cannot reach the MailCapture API. The original exception is available via cause (Ruby’s built-in cause on exceptions).

Instance Attribute Summary

Attributes inherited from Error

#code

Instance Method Summary collapse

Constructor Details

#initialize(base_url, original_error = nil) ⇒ NetworkError

Returns a new instance of NetworkError.



64
65
66
67
68
69
70
71
# File 'lib/mailcapture/errors.rb', line 64

def initialize(base_url, original_error = nil)
  @original_error = original_error
  super(
    "Could not reach the MailCapture API at #{base_url}. " \
    'Check your network connection and firewall settings.',
    code: 'NETWORK_ERROR'
  )
end