Browse Source

comment

main
pvincent 3 months ago
parent
commit
714afcabd2
  1. 1
      app/controllers/scores_controller.rb
  2. 9
      lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb

1
app/controllers/scores_controller.rb

@ -37,7 +37,6 @@ class ScoresController < ApplicationController
end
def destroy
raise 'azazazaza'
# @score.destroy!
# redirect_to scores_url, notice: 'Score was successfully destroyed.', status: :see_other

9
lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb

@ -1,24 +1,22 @@
require 'action_dispatch/middleware/exception_wrapper'
require 'action_dispatch/routing/inspector'
require 'action_view'
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
private
def render_exception(request, exception, wrapper)
## PVINCENT's ADDITION for TagWrapError
log_error(request, wrapper)
if exception.is_a?(Semantic::TagWrapError)
backtrace_cleaner = request.get_header('action_dispatch.backtrace_cleaner')
wrapper = ExceptionWrapper.new(backtrace_cleaner, exception.error)
end
## HERE it was commented off
# log_error(request, wrapper)
## END OF ADDITION
raise exception unless request.get_header('action_dispatch.show_detailed_exceptions')
@ -28,7 +26,6 @@ module ActionDispatch
rescue ActionDispatch::Http::MimeNegotiation::InvalidType
content_type = Mime[:text]
end
if api_request?(content_type)
render_for_api_request(content_type, wrapper)
else

Loading…
Cancel
Save