Exception: Unbound::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/unbound/exceptions.rb

Overview

An APIError is the result of a failure in an unbound api call. It expects an error code and translates that into a human-readable string.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code) ⇒ APIError

Returns a new instance of APIError.



11
12
13
14
15
# File 'lib/unbound/exceptions.rb', line 11

def initialize(error_code)
  @error_code = error_code
  msg = Unbound::Bindings.ub_strerror(@error_code)
  super(msg)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



10
11
12
# File 'lib/unbound/exceptions.rb', line 10

def error_code
  @error_code
end