Exception: Traim::Error

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Error

Returns a new instance of Error.



190
191
192
193
194
# File 'lib/traim.rb', line 190

def initialize(options = {})
  @message = options[:message] || error_message 
  @body    = options[:body]    || error_message
  super(@message)
end

Instance Method Details

#bodyObject



199
# File 'lib/traim.rb', line 199

def body; {message: @body} end

#error_messageObject



197
# File 'lib/traim.rb', line 197

def error_message; 'Internal Server Error' end

#headerObject



198
# File 'lib/traim.rb', line 198

def header; DEFAULT_HEADER end

#statusObject



196
# File 'lib/traim.rb', line 196

def status; 500 end