Sha256: d35360356b9966433acacd0ae843ce8586563827f1577bed36b3e33e9cd083b0
Contents?: true
Size: 1.05 KB
Versions: 3
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require_relative "../../exceptions_base" require_relative "../../../constants/errors" require_relative "undefined_table" require_relative "undefined_column" module Exceptions module ActiveRecord module StatementInvalid class Handler < ExceptionsBase attr_reader :exception, :output, :pry def initialize(output, exception, pry) @output = output @exception = exception @pry = pry end # FIXME: https://github.com/rubocop/rubocop-performance/issues/438 # rubocop:disable Performance/ConstantRegexp def call case exception.message in /#{Constants::Errors::UNDEFINED_TABLE}/ UndefinedTable.call(output, exception, pry) in /#{Constants::Errors::UNDEFINED_COLUMN}/ UndefinedColumn.call(output, exception, pry) else Pry::ExceptionHandler.handle_exception(output, exception, pry) end end # rubocop:enable Performance/ConstantRegexp end end end end
Version data entries
3 entries across 3 versions & 1 rubygems