digital-fabric / extralite

Ruby on SQLite
http://www.rubydoc.info/gems/extralite
MIT License
255 stars 8 forks source link

fix: error must be derived from ::StandardError #10

Closed sitano closed 1 year ago

sitano commented 1 year ago

otherwise, it is incorrectly translated by ActiveRecord::AbstractAdapter

# lib/active_record/connection_adapters/abstract_adapter.rb:589

def translate_exception(exception, message)
  # override in derived class
  case exception
  when RuntimeError
    exception
  else
    ActiveRecord::StatementInvalid.new(message)
  end
end

it also breaks compatibility with SQLite3 gem by much.