|
@ -1,24 +1,22 @@ |
|
|
require 'action_dispatch/middleware/exception_wrapper' |
|
|
require 'action_dispatch/middleware/exception_wrapper' |
|
|
require 'action_dispatch/routing/inspector' |
|
|
require 'action_dispatch/routing/inspector' |
|
|
|
|
|
|
|
|
require 'action_view' |
|
|
require 'action_view' |
|
|
|
|
|
|
|
|
module ActionDispatch |
|
|
module ActionDispatch |
|
|
# patched class to prevent deprecated message |
|
|
|
|
|
|
|
|
# THIS IS A HACK TO unwrap TagWrapError when detected! |
|
|
|
|
|
# TagWrapError contains a 'tag' for SemanticLogger and the cause itself |
|
|
class DebugExceptions |
|
|
class DebugExceptions |
|
|
private |
|
|
private |
|
|
|
|
|
|
|
|
def render_exception(request, exception, wrapper) |
|
|
def render_exception(request, exception, wrapper) |
|
|
## PVINCENT's ADDITION for TagWrapError |
|
|
## PVINCENT's ADDITION for TagWrapError |
|
|
log_error(request, wrapper) |
|
|
log_error(request, wrapper) |
|
|
|
|
|
|
|
|
if exception.is_a?(Semantic::TagWrapError) |
|
|
if exception.is_a?(Semantic::TagWrapError) |
|
|
backtrace_cleaner = request.get_header('action_dispatch.backtrace_cleaner') |
|
|
backtrace_cleaner = request.get_header('action_dispatch.backtrace_cleaner') |
|
|
wrapper = ExceptionWrapper.new(backtrace_cleaner, exception.error) |
|
|
wrapper = ExceptionWrapper.new(backtrace_cleaner, exception.error) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
## HERE it was commented off |
|
|
# log_error(request, wrapper) |
|
|
# log_error(request, wrapper) |
|
|
|
|
|
|
|
|
## END OF ADDITION |
|
|
## END OF ADDITION |
|
|
|
|
|
|
|
|
raise exception unless request.get_header('action_dispatch.show_detailed_exceptions') |
|
|
raise exception unless request.get_header('action_dispatch.show_detailed_exceptions') |
|
@ -28,7 +26,6 @@ module ActionDispatch |
|
|
rescue ActionDispatch::Http::MimeNegotiation::InvalidType |
|
|
rescue ActionDispatch::Http::MimeNegotiation::InvalidType |
|
|
content_type = Mime[:text] |
|
|
content_type = Mime[:text] |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
if api_request?(content_type) |
|
|
if api_request?(content_type) |
|
|
render_for_api_request(content_type, wrapper) |
|
|
render_for_api_request(content_type, wrapper) |
|
|
else |
|
|
else |
|
|