class Puppet::Network::FormatHandler::FormatProtector

Attributes

format[R]

Public Class Methods

new(format) click to toggle source
# File lib/puppet/network/format_handler.rb, line 20
def initialize(format)
  @format = format
end

Public Instance Methods

protect(method, args) click to toggle source
# File lib/puppet/network/format_handler.rb, line 11
def protect(method, args)
    Puppet::Network::FormatHandler.format(format).send(method, *args)
rescue => details
    direction = method.to_s.include?("intern") ? "from" : "to"
    error = FormatError.new("Could not #{method} #{direction} #{format}: #{details}")
    error.set_backtrace(details.backtrace)
    raise error
end