Sha256: fc627a657472041371a91f17228ee6604a3bc11b06009e2b21f3f1e9c7a84d0b

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

module ROM
  module SQL
    module Commands
      # Shared error handler for all SQL commands
      #
      # @api private
      module ErrorWrapper
        # Handle Sequel errors and re-raise ROM-specific errors
        #
        # @api public
        def call(*args)
          super
        rescue *ERROR_MAP.keys => e
          raise ERROR_MAP[e.class], e
        end

        alias_method :[], :call
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-sql-0.8.0 lib/rom/sql/commands/error_wrapper.rb
rom-sql-0.7.0 lib/rom/sql/commands/error_wrapper.rb
rom-sql-0.7.0.rc1 lib/rom/sql/commands/error_wrapper.rb
rom-sql-0.7.0.beta1 lib/rom/sql/commands/error_wrapper.rb