Exception: ContentGateway::BaseError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_url, wrapped_exception = nil, status_code = nil, info = nil) ⇒ BaseError

Returns a new instance of BaseError.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/content_gateway/exceptions.rb', line 5

def initialize(resource_url, wrapped_exception = nil, status_code = nil, info = nil)
  @resource_url = resource_url
  @wrapped_exception = wrapped_exception
  @status_code = status_code
  @info = info

  message = @resource_url.dup
  if @wrapped_exception
    message << " - #{@wrapped_exception.message}"
    message << " - #{@info}" if @info
  end

  super(message)
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



3
4
5
# File 'lib/content_gateway/exceptions.rb', line 3

def info
  @info
end

#resource_urlObject (readonly)

Returns the value of attribute resource_url.



3
4
5
# File 'lib/content_gateway/exceptions.rb', line 3

def resource_url
  @resource_url
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



3
4
5
# File 'lib/content_gateway/exceptions.rb', line 3

def status_code
  @status_code
end

#wrapped_exceptionObject (readonly)

Returns the value of attribute wrapped_exception.



3
4
5
# File 'lib/content_gateway/exceptions.rb', line 3

def wrapped_exception
  @wrapped_exception
end