Exception: Aspera::Plugins::Server::AsCmd::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Aspera::Plugins::Server::AsCmd::Error
- Defined in:
- lib/aspera/plugins/server/ascmd.rb
Overview
Raised when one or more commands of ascmd failed. The other commands were executed.
Subclass NotFound or AccessDenied when all commands failed for this reason.
Direct Known Subclasses
Defined Under Namespace
Classes: Failure
Instance Attribute Summary collapse
-
#failures ⇒ Array<Failure>
readonly
Failed commands, in order.
-
#operation ⇒ Symbol
readonly
The operation.
Instance Method Summary collapse
-
#extended_message ⇒ String
One line per failed command, with its arguments.
-
#initialize(operation, failures) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(operation, failures) ⇒ Error
Returns a new instance of Error.
101 102 103 104 105 |
# File 'lib/aspera/plugins/server/ascmd.rb', line 101 def initialize(operation, failures) @operation = operation @failures = failures super(failures.map { |f| "ascmd: #{f.errstr}#{" (#{f.errno})" unless f.errno.nil?}" }.join("\n")) end |
Instance Attribute Details
#failures ⇒ Array<Failure> (readonly)
Returns failed commands, in order.
97 98 99 |
# File 'lib/aspera/plugins/server/ascmd.rb', line 97 def failures @failures end |
#operation ⇒ Symbol (readonly)
Returns the operation.
95 96 97 |
# File 'lib/aspera/plugins/server/ascmd.rb', line 95 def operation @operation end |
Instance Method Details
#extended_message ⇒ String
Returns one line per failed command, with its arguments.
108 109 110 |
# File 'lib/aspera/plugins/server/ascmd.rb', line 108 def @failures.map { |f| %Q{errno=#{f.errno} errstr="#{f.errstr}" command=#{@operation} arguments=#{f.arguments.join(',')}} }.join("\n") end |