Exception: Shaf::Errors::ServerError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = "Unknown error", code: nil, title: nil) ⇒ ServerError

Returns a new instance of ServerError.



10
11
12
13
14
# File 'lib/shaf/errors.rb', line 10

def initialize(msg = "Unknown error", code: nil, title: nil)
  super(msg)
  @code = code || "UNKNOWN_ERROR"
  @title = title || "Something bad happend"
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/shaf/errors.rb', line 4

def code
  @code
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/shaf/errors.rb', line 4

def title
  @title
end

Instance Method Details

#http_statusObject



6
7
8
# File 'lib/shaf/errors.rb', line 6

def http_status
  500
end