Exception: ChefAPI::Error::ChefAPIError
- Inherits:
-
StandardError
- Object
- StandardError
- ChefAPI::Error::ChefAPIError
- Defined in:
- lib/chef-api/errors.rb
Direct Known Subclasses
AbstractMethod, CannotRegenerateKey, FileNotFound, HTTPError, HTTPUnauthorizedRequest, InsufficientFilePermissions, InvalidResource, InvalidValidator, MissingURLParameter, NotADirectory, ResourceAlreadyExists, ResourceNotFound, ResourceNotMutable, UnknownAttribute
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ChefAPIError
constructor
A new instance of ChefAPIError.
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(options = {}) ⇒ ChefAPIError
Returns a new instance of ChefAPIError.
18 19 20 21 22 23 |
# File 'lib/chef-api/errors.rb', line 18 def initialize( = {}) @options = @filename = .delete(:_template) super() end |
Instance Method Details
#message ⇒ Object Also known as: to_s
25 26 27 28 |
# File 'lib/chef-api/errors.rb', line 25 def erb = ERB.new(File.read(template)) erb.result(ErrorBinding.new(@options).get_binding) end |