From 714afcabd23199859baeb37d6da054b4fb7829b1 Mon Sep 17 00:00:00 2001 From: pvincent Date: Tue, 10 Sep 2024 22:21:03 +0400 Subject: [PATCH] comment --- app/controllers/scores_controller.rb | 1 - .../action_dispatch/middleware/debug_exceptions.rb | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/scores_controller.rb b/app/controllers/scores_controller.rb index 72df508..ddc07d9 100644 --- a/app/controllers/scores_controller.rb +++ b/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 diff --git a/lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb b/lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb index 8ac8504..bbaff35 100644 --- a/lib/monkey_patches/action_dispatch/middleware/debug_exceptions.rb +++ b/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