2012-01-14 21:18:39 +01:00
|
|
|
# Support rack/showexceptions during development
|
2012-05-07 23:41:39 +02:00
|
|
|
module Middleman
|
|
|
|
module CoreExtensions
|
|
|
|
module ShowExceptions
|
2014-01-01 23:50:42 +01:00
|
|
|
def self.included(app)
|
|
|
|
# Require lib
|
|
|
|
require 'rack/showexceptions'
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2014-01-01 23:50:42 +01:00
|
|
|
# Whether to catch and display exceptions
|
|
|
|
# @return [Boolean]
|
|
|
|
app.config.define_setting :show_exceptions, true, 'Whether to catch and display exceptions'
|
2012-10-14 07:37:24 +02:00
|
|
|
|
2014-01-01 23:50:42 +01:00
|
|
|
# When in dev
|
|
|
|
app.configure :development do
|
|
|
|
# Include middlemare
|
2014-04-29 20:43:05 +02:00
|
|
|
use ::Rack::ShowExceptions if config[:show_exceptions]
|
2011-12-09 20:11:17 +01:00
|
|
|
end
|
|
|
|
end
|
2012-05-07 23:41:39 +02:00
|
|
|
end
|
2011-12-09 20:11:17 +01:00
|
|
|
end
|
2012-08-14 00:39:06 +02:00
|
|
|
end
|