Exception: Aspera::Transfer::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/aspera/transfer/error.rb

Overview

Error raised if transfer fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description, code: nil) ⇒ 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_codeObject (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

#infoHash



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) && message.eql?('Target address not available')
  info[:r]
end