Exception: Aptly::Errors::RepositoryFileError
- Inherits:
-
StandardError
- Object
- StandardError
- Aptly::Errors::RepositoryFileError
- Defined in:
- lib/aptly/errors.rb
Overview
Raised when a file operation had an error.
Instance Attribute Summary collapse
-
#failures ⇒ Array<String>
List of failed files.
-
#warnings ⇒ Array<String>
Warnings from remote (one per file generally).
Class Method Summary collapse
-
.from_hash(hash, *args) ⇒ RepositoryFileError?
Construct a new instance from a hash.
Instance Method Summary collapse
-
#initialize(failures, warnings, *args) ⇒ RepositoryFileError
constructor
Create a new error instance.
-
#to_s ⇒ String
(formatted) string representation.
Constructor Details
#initialize(failures, warnings, *args) ⇒ RepositoryFileError
Create a new error instance.
47 48 49 50 51 |
# File 'lib/aptly/errors.rb', line 47 def initialize(failures, warnings, *args) super(*args) @failures = failures @warnings = warnings end |
Instance Attribute Details
#failures ⇒ Array<String>
Returns list of failed files.
37 38 39 |
# File 'lib/aptly/errors.rb', line 37 def failures @failures end |
#warnings ⇒ Array<String>
Returns warnings from remote (one per file generally).
41 42 43 |
# File 'lib/aptly/errors.rb', line 41 def warnings @warnings end |
Class Method Details
.from_hash(hash, *args) ⇒ RepositoryFileError?
Construct a new instance from a hash
72 73 74 75 |
# 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 |
Instance Method Details
#to_s ⇒ String
Returns (formatted) string representation.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/aptly/errors.rb', line 54 def to_s <<-DESCRIPTION ~~~ Failed to process: #{failures.join("\n ")} Warnings: #{warnings.join("\n ")} ~~~ DESCRIPTION end |