Module: ROM::SQL::Commands::ErrorWrapper Private

Included in:
Create, Delete, Update
Defined in:
lib/rom/sql/commands/error_wrapper.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Shared error handler for all SQL commands

Instance Method Summary collapse

Instance Method Details

#call(*args) ⇒ Hash+ Also known as: []

Handle Sequel errors and re-raise ROM-specific errors

Returns:

  • (Hash, Array<Hash>)

Raises:

  • SQL::Error


17
18
19
20
21
# File 'lib/rom/sql/commands/error_wrapper.rb', line 17

def call(*args)
  super
rescue *ERROR_MAP.keys => e
  raise ERROR_MAP.fetch(e.class, Error), e
end