Exception: Start::StartError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/start/errors/start_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, code = nil, http_status = nil, extras = {}) ⇒ StartError

Returns a new instance of StartError.



5
6
7
8
9
10
# File 'lib/start/errors/start_error.rb', line 5

def initialize(message = nil, code = nil, http_status = nil, extras = {})
  @message = message
  @code = code
  @http_status = http_status
  @extras = extras
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/start/errors/start_error.rb', line 3

def code
  @code
end

#extrasObject (readonly)

Returns the value of attribute extras.



3
4
5
# File 'lib/start/errors/start_error.rb', line 3

def extras
  @extras
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



3
4
5
# File 'lib/start/errors/start_error.rb', line 3

def http_status
  @http_status
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/start/errors/start_error.rb', line 3

def message
  @message
end

Instance Method Details

#to_sObject



12
13
14
15
# File 'lib/start/errors/start_error.rb', line 12

def to_s
  status_string = @http_status.nil? ? "" : "(#{@code}Error - Status #{@http_status}) "
  "#{status_string}#{@message}"
end