Class: AutoApi::Base

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/auto_api/base.rb

Instance Method Summary collapse

Instance Method Details

#webtry(block) ⇒ Object



86
87
88
89
90
91
92
93
94
95
# File 'lib/auto_api/base.rb', line 86

def webtry(block)
  begin
   status 200
   block.call
  rescue Mongoid::Errors::DocumentNotFound
    status 404
  rescue
    status 500
  end
end