From 6b7b1c71130d1fffefa5feada97ea9f848981077 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 9 Sep 2024 21:26:59 +0400 Subject: [PATCH] computed_exception --- app/controllers/scores_controller.rb | 1 + lib/semantic/ansi_formatter.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/scores_controller.rb b/app/controllers/scores_controller.rb index ddc07d9..43a20c5 100644 --- a/app/controllers/scores_controller.rb +++ b/app/controllers/scores_controller.rb @@ -37,6 +37,7 @@ class ScoresController < ApplicationController end def destroy + raise 'not permitted' # @score.destroy! # redirect_to scores_url, notice: 'Score was successfully destroyed.', status: :see_other diff --git a/lib/semantic/ansi_formatter.rb b/lib/semantic/ansi_formatter.rb index 39e856a..b82757c 100644 --- a/lib/semantic/ansi_formatter.rb +++ b/lib/semantic/ansi_formatter.rb @@ -36,7 +36,11 @@ module Semantic self.logger = logger self.color = color_map[log.level] - wrap_level(compute_useful_length, message, payload, exception) + computed_exception = exception + result = wrap_level(compute_useful_length, message, payload, computed_exception) + return result unless computed_exception + + result << "\n" << build_terminus end def reject(log)