Exception: Mojito::MojitoException

Inherits:
Exception
  • Object
show all
Defined in:
lib/mojito/helpers/exception_handling.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status = 500, message = STATUS[status].message) ⇒ MojitoException

Returns a new instance of MojitoException.



7
8
9
10
# File 'lib/mojito/helpers/exception_handling.rb', line 7

def initialize(status = 500, message = STATUS[status].message)
	super(message)
	@status = Mojito::STATUS[status].code
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/mojito/helpers/exception_handling.rb', line 12

def status
  @status
end

Instance Method Details

#to_responseObject



14
15
16
# File 'lib/mojito/helpers/exception_handling.rb', line 14

def to_response
	Rack::Response.new [], status, 'Content-Type' => 'application/octet-stream'
end