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(message, err_code = nil) ⇒ Error

Returns a new instance of Error.



11
12
13
14
# File 'lib/aspera/transfer/error.rb', line 11

def initialize(message, err_code=nil)
  super(message)
  @err_code = err_code
end

Instance Attribute Details

#err_codeObject (readonly)

Returns the value of attribute err_code.



9
10
11
# File 'lib/aspera/transfer/error.rb', line 9

def err_code
  @err_code
end

Instance Method Details

#infoObject



16
17
18
19
# File 'lib/aspera/transfer/error.rb', line 16

def info
  r = ERROR_INFO[@err_code] || {r: false, c: 'UNKNOWN', m: 'unknown', a: 'unknown'}
  return r.merge({i: @err_code})
end

#retryable?Boolean

Returns:

  • (Boolean)


21
# File 'lib/aspera/transfer/error.rb', line 21

def retryable?; info[:r]; end