Exception: Shaf::Errors::ServerError

Inherits:
Shaf::Error
  • 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.



12
13
14
15
16
# File 'lib/shaf/errors.rb', line 12

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.



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

def code
  @code
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#http_statusObject



8
9
10
# File 'lib/shaf/errors.rb', line 8

def http_status
  500
end