lib/mkit/app/mkit_server.rb in mkit-0.3.0 vs lib/mkit/app/mkit_server.rb in mkit-0.4.0

- old
+ new

@@ -1,8 +1,20 @@ require 'mkit/exceptions' module MKIt class Server < Sinatra::Base set :default_content_type, :json - # set :dump_errors, false + set :dump_errors, true + set :show_exceptions, false + set :raise_errors, false + + error MKIt::BaseException do |e| + MKItLogger.debug e + error e.error_code, e.message + end + + error do |e| + MKItLogger.debug e + error 500, e.message + end end end