def parse_error(error)
      case error
      when SocketError
        PuppetDebugger::Exception::ConnectError.new(message: "Unknown host: #{Puppet[:server]}")
      when Net::HTTPError
        PuppetDebugger::Exception::AuthError.new(message: error.message)
      when Errno::ECONNREFUSED
        PuppetDebugger::Exception::ConnectError.new(message: error.message)
      when Puppet::Error
        if error.message =~ /could\ not\ find\ class/i
          PuppetDebugger::Exception::NoClassError.new(default_modules_paths: default_modules_paths,
                                                      message: error.message)
        elsif error.message =~ /default\ node/i
          PuppetDebugger::Exception::NodeDefinitionError.new(default_site_manifest: default_site_manifest,
                                                             message: error.message)
        else
          error
        end
      else
        error
      end
    end
def parse_error(error)
      case error
      when SocketError
        PuppetDebugger::Exception::ConnectError.new(message: "Unknown host: #{Puppet[:server]}")
      when Net::HTTPError
        PuppetDebugger::Exception::AuthError.new(message: error.message)
      when Errno::ECONNREFUSED
        PuppetDebugger::Exception::ConnectError.new(message: error.message)
      when Puppet::Error
        if error.message =~ /could\ not\ find\ class/i
          PuppetDebugger::Exception::NoClassError.new(default_modules_paths: default_modules_paths,
                                                      message: error.message)
        elsif error.message =~ /default\ node/i
          PuppetDebugger::Exception::NodeDefinitionError.new(default_site_manifest: default_site_manifest,
                                                             message: error.message)
        else
          error
        end
      else
        error
      end
    end
parses the error type into a more useful error message defined in errors.rb
 returns new error object or the original if error cannot be parsed