Class: PG::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/pg/em.rb

Instance Method Summary collapse

Instance Method Details

#checkObject Also known as: check_result



468
469
470
471
472
473
474
475
476
477
478
# File 'lib/pg/em.rb', line 468

def check
  case result_status
    when PG::PGRES_BAD_RESPONSE,
         PG::PGRES_FATAL_ERROR,
         PG::PGRES_NONFATAL_ERROR
      error = PG::Error.new(error_message)
      error.instance_variable_set(:@result, self)
      error.instance_variable_set(:@connection, @connection)
      raise error
  end
end