Exception: Hyrax::DOI::DataCiteClient::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
app/services/hyrax/doi/datacite_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = '', response = nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • msg (String) (defaults to: '')
  • response (Faraday::Response) (defaults to: nil)


91
92
93
94
95
96
97
98
99
# File 'app/services/hyrax/doi/datacite_client.rb', line 91

def initialize(msg = '', response = nil)
  if response
    @status = response.status
    msg += "\n#{@status}: #{response.reason_phrase}\n"
    msg += response.body
  end

  super(msg)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



86
87
88
# File 'app/services/hyrax/doi/datacite_client.rb', line 86

def status
  @status
end