From b1f77e1503cd081b51186679b55e637a8b1129ca Mon Sep 17 00:00:00 2001 From: "Nate Hopkins (hopsoft)" Date: Thu, 4 Jan 2024 15:56:10 -0700 Subject: [PATCH] Retain standard 500 status for errors --- lib/turbo_boost/commands/errors.rb | 2 +- lib/turbo_boost/commands/http_status_codes.rb | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/turbo_boost/commands/errors.rb b/lib/turbo_boost/commands/errors.rb index da0f02e7..d517c785 100644 --- a/lib/turbo_boost/commands/errors.rb +++ b/lib/turbo_boost/commands/errors.rb @@ -38,7 +38,7 @@ def initialize(message = "", **kwargs) class PerformError < CommandError def initialize(message = "Unexpected error in TurboBoost Command!", **kwargs) - super(message, http_status: :unhandled_turbo_boost_command_error, **kwargs) + super(message, http_status: :internal_server_error, **kwargs) end end end diff --git a/lib/turbo_boost/commands/http_status_codes.rb b/lib/turbo_boost/commands/http_status_codes.rb index f9e85902..2889d47f 100644 --- a/lib/turbo_boost/commands/http_status_codes.rb +++ b/lib/turbo_boost/commands/http_status_codes.rb @@ -2,11 +2,9 @@ module TurboBoost::Commands HTTP_ABORT_STATUS_CODE = 285 # I-285 is the most congested highway in the US (traffic jams → halt/abort) - HTTP_ERROR_STATUS_CODE = 595 # I-95 is the most dangerous highway in the US (fatal accidents → error) HTTP_STATUS_CODES = Rack::Utils::HTTP_STATUS_CODES.merge( - HTTP_ABORT_STATUS_CODE => "Abort TurboBoost Command", - HTTP_ERROR_STATUS_CODE => "Unhandled TurboBoost Command Error" + HTTP_ABORT_STATUS_CODE => "Abort TurboBoost Command" ).freeze def self.http_status_code(value) @@ -15,7 +13,6 @@ def self.http_status_code(value) case value.to_sym when :abort_turbo_boost_command then HTTP_ABORT_STATUS_CODE - when :unhandled_turbo_boost_command_error then HTTP_ERROR_STATUS_CODE else Rack::Utils::SYMBOL_TO_STATUS_CODE[value.to_sym] end end