Title / Description
Code class Sinatra::Base def call(env) begin dup.call!(env) rescue => e res = [500,{},[]] if (ENV['HERBERT_DEBUG'].to_i==1) || (ENV['RACK_ENV'] =~ /debug/) then res[1] = {"Content-Type" => "application/json;charset=utf-8"} res[2] = ActiveSupport::JSON.encode({ :error => { :code => 1, :message => e.to_s, :backtrace => e.backtrace } }) end res end end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code