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.
17 18 19 20 |
# File 'lib/aspera/transfer/error.rb', line 17 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
13 14 15 |
# File 'lib/aspera/transfer/error.rb', line 13 def err_code @err_code end |
Instance Method Details
#info ⇒ Hash
Returns Information on that error.
23 24 25 26 |
# File 'lib/aspera/transfer/error.rb', line 23 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 ?
30 31 32 33 |
# File 'lib/aspera/transfer/error.rb', line 30 def retryable? return false if @err_code.eql?(14) && .eql?('Target address not available') info[:r] end |