Exception: PuppetForge::ErrorWithDetail
- Defined in:
- lib/puppet_forge/error.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Error
Class Method Summary collapse
Methods inherited from Error
Constructor Details
This class inherits a constructor from PuppetForge::Error
Class Method Details
.from_response(response) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/puppet_forge/error.rb', line 33 def self.from_response(response) body = JSON.parse(response[:body]) = body['message'] if body.key?('errors') && !body['errors']&.empty? << "\nThe following errors were returned from the server:\n - #{body['errors'].join("\n - ")}" end new() end |