http://www.sinatrarb.com/intro.html#Error%20Handling ãã¡ããè¦ãã¨ä¾å¤ã¯Rackãªãã¸ã§ã¯ãã®sinatra.errorã«å ¥ã£ã¦ããã¨ãããããããã¯å¼æ°ã¨ãã¦ãåãåããã¨ãã§ããã (ãã¼ã¸ã§ã³1.4.4ã§ç¢ºèª) require "sinatra" # developmentã¢ã¼ãã§ããããã°è¡¨ç¤ºãããªã set :show_exceptions, false # ãããã¯å¼æ°ã§ä¾å¤ãªãã¸ã§ã¯ããåãåã error do |e| status 500 # ããã§ãã§ãããã© #body env['sinatra.error'].message # ããã§ããã body e.message end get "/hoge" do raise "hoge" end $ bundle exec ruby app.rb $ curl lo
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}