Exception: Aspera::Transfer::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Aspera::Transfer::Error
- Defined in:
- lib/aspera/transfer/error.rb
Overview
Error raised if transfer fails
Instance Attribute Summary collapse
-
#err_code ⇒ Object
readonly
Error code like on management port.
Instance Method Summary collapse
-
#info ⇒ Hash
Information on that error.
-
#initialize(description, code: nil) ⇒ Error
constructor
A new instance of Error.
-
#retryable? ⇒ Boolean
Is that transfer error retryable ?.
Constructor Details
#initialize(description, code: nil) ⇒ Error
Returns a new instance of Error.
14 15 16 17 |
# File 'lib/aspera/transfer/error.rb', line 14 def initialize(description, code: nil) super(description) @err_code = code.to_i end |
Instance Attribute Details
#err_code ⇒ Object (readonly)
Error code like on management port
10 11 12 |
# File 'lib/aspera/transfer/error.rb', line 10 def err_code @err_code end |
Instance Method Details
#info ⇒ Hash
Returns Information on that error.
20 21 22 23 |
# File 'lib/aspera/transfer/error.rb', line 20 def info r = Ascp::Management::ERRORS[@err_code] || Ascp::Management::ERRORS[0] return r.merge({i: @err_code}) end |
#retryable? ⇒ Boolean
Is that transfer error retryable ?
27 28 29 30 |
# File 'lib/aspera/transfer/error.rb', line 27 def retryable? return false if @err_code.eql?(14) && .eql?('Target address not available') info[:r] end |