class Conjur::Error
The base Conjur
error class. Rescue it to catch errors generated by the Conjur
services.
Public Class Methods
create(body)
click to toggle source
Create a new instance based on structured error info. @param [String] body JSON error information @return [Error, nil] the exception instance or nil if body
doesn’t
contain valid error info
# File lib/patches/conjur/error.rb, line 35 def self.create body error = JSON.parse(body)['error'] kind = error['kind'] klass = const_defined?(kind) && const_get(kind) || self klass.new error rescue nil end
new(error)
click to toggle source
Calls superclass method
# File lib/patches/conjur/error.rb, line 90 def initialize error @error = error super message end
Public Instance Methods
details()
click to toggle source
kind()
click to toggle source
@!attribute [r] kind @return [String] error kind, as returned by the Conjur
service @note Usually it will equal the class name.
# File lib/patches/conjur/error.rb, line 61 def kind @error['kind'] end