Exception: ShipEngine::Exceptions::ShipEngineError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/shipengine/exceptions.rb

Direct Known Subclasses

SystemError, ValidationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, source:, type:, code:, url: nil) ⇒ ShipEngineError

Returns a new instance of ShipEngineError.



13
14
15
16
17
18
19
20
21
# File 'lib/shipengine/exceptions.rb', line 13

def initialize(message:, source:, type:, code:, url: nil)
  code = ShipEngine::Errors::ErrorCode.get(code) if code.is_a?(String)
  source = ShipEngine::Errors::ErrorSource.get(source) if source.is_a?(String)
  super(message)
  @source = source
  @type = type
  @code = code
  @url = url
end

Instance Attribute Details

#codeObject (readonly)

message is inherited



11
12
13
# File 'lib/shipengine/exceptions.rb', line 11

def code
  @code
end

#sourceObject (readonly)

message is inherited



11
12
13
# File 'lib/shipengine/exceptions.rb', line 11

def source
  @source
end

#typeObject (readonly)

message is inherited



11
12
13
# File 'lib/shipengine/exceptions.rb', line 11

def type
  @type
end

#urlObject (readonly)

message is inherited



11
12
13
# File 'lib/shipengine/exceptions.rb', line 11

def url
  @url
end