class Aptly::Errors::RepositoryFileError

Raised when a file operation had an error.

Attributes

failures[RW]

@!attribute [r] failures

@return [Array<String>] list of failed files
warnings[RW]

@!attribute [r] warnings

@return [Array<String>] warnings from remote (one per file generally)

Public Class Methods

from_hash(hash, *args) click to toggle source

Construct a new instance from a hash @param hash a file operation repsonse hash @return [RepositoryFileError] new error @return [nil] if error is not applicable (hash has empty FailedFiles

array)
# File lib/aptly/errors.rb, line 72
def from_hash(hash, *args)
  return nil if hash['FailedFiles'].empty?
  new(hash['FailedFiles'], hash['Report']['Warnings'], *args)
end
new(failures, warnings, *args) click to toggle source

Create a new error instance. @param failures see {#failures} @param warnings see {#warnings} @param args forwarded to super

Calls superclass method
# File lib/aptly/errors.rb, line 47
def initialize(failures, warnings, *args)
  super(*args)
  @failures = failures
  @warnings = warnings
end

Public Instance Methods

to_s() click to toggle source

@return [String] (formatted) string representation

# File lib/aptly/errors.rb, line 54
      def to_s
        <<-DESCRIPTION

~~~
  Failed to process:
    #{failures.join("\n    ")}
  Warnings:
    #{warnings.join("\n    ")}
~~~
        DESCRIPTION
      end