Exception: Easyship::Errors::EasyshipError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/easyship/errors/easyship_error.rb

Overview

Represents an error that is raised when an error occurs in the Easyship API.

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: '', body_error: {}, error: {}, response_body: nil, response_headers: {}) ⇒ EasyshipError

Returns a new instance of EasyshipError.



9
10
11
12
13
14
15
16
# File 'lib/easyship/errors/easyship_error.rb', line 9

def initialize(message: '', body_error: {}, error: {}, response_body: nil, response_headers: {})
  super(message)
  @error = error
  @message = message
  @body_error = body_error
  @response_body = response_body
  @response_headers = response_headers
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



7
8
9
# File 'lib/easyship/errors/easyship_error.rb', line 7

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



7
8
9
# File 'lib/easyship/errors/easyship_error.rb', line 7

def message
  @message
end

#response_bodyObject (readonly)

Returns the value of attribute response_body.



7
8
9
# File 'lib/easyship/errors/easyship_error.rb', line 7

def response_body
  @response_body
end

#response_headersObject (readonly)

Returns the value of attribute response_headers.



7
8
9
# File 'lib/easyship/errors/easyship_error.rb', line 7

def response_headers
  @response_headers
end

Instance Method Details

#body_errorObject



18
19
20
21
# File 'lib/easyship/errors/easyship_error.rb', line 18

def body_error
  warn '[DEPRECATION] `body_error` is deprecated. Please use `error` instead.'
  @body_error
end