pgx 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pgx.rb +7 -7
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7795026fac56ac284b9a0d68eedb9428c6484b03
4
- data.tar.gz: 570fbd7c002ad55e4b7f06dacad93a4f399d8afe
3
+ metadata.gz: e64a6286a552d8965937dae974399bd0593a938c
4
+ data.tar.gz: ff52f016614eef055168a8ae1f44600900907d74
5
5
  SHA512:
6
- metadata.gz: 099637afbd1eaa729e890ee47b8d03545a7bcb62bb6d1e7db898a00614da7b6311b3341217eae48cb7aed475d21a57bda42f1657e5a16367c6a11e53ace26e90
7
- data.tar.gz: f3d5e351210936ad2fadd526e8cc2333f4447b7013aef23719a3eeb85450914792d87112db6bb651cb19342d7ac0c26ac7a5f17a34ec41c384524d53f80a1185
6
+ metadata.gz: 9993cde62a811087e8ee0488a6d358fbfbf215f8a7d8d204084d83dd22fab9d4e606877c74c83364d91a3f312f7805f3bb8b56e480af7e9a0038c81dd1f3c8b3
7
+ data.tar.gz: d107034dc8eab9ba993eacfcb3029735fa3311008686cbcb5aa693a21045de3c5018c89e79ecedbcaa2c047c255afed41a27e3bc1d29932168340bdd92b9693f
data/lib/pgx.rb CHANGED
@@ -238,7 +238,7 @@ module PGx
238
238
  def connected?
239
239
  begin
240
240
  return(status() == PG::CONNECTION_OK ? true : false)
241
- rescue PGError => e
241
+ rescue PG::Error => e
242
242
  return false
243
243
  end
244
244
  end
@@ -320,7 +320,7 @@ module PGx
320
320
  @connection = caller_super.call # run the parent 'pg' function, new()
321
321
  log_debug 'calling connection initialization proc'
322
322
  @connect_init.call(@connection)
323
- rescue PGError => e
323
+ rescue PG::Error => e
324
324
  try_count = try_count + 1
325
325
  log_error %Q{#{e.class}, #{e.message.chomp}}
326
326
  if @connect_retry_sleep.nil? or e.message =~ /^FATAL/
@@ -341,7 +341,7 @@ module PGx
341
341
  transaction_reprepare(caller_method) # just prior to retrying the transaction
342
342
  log_debug function_call_string(caller_method, args)
343
343
  caller_super.call # run the parent 'pg' function
344
- rescue PGError => e
344
+ rescue PG::Error => e
345
345
  if connected? # if we are connected, it's an SQL related error
346
346
  if not method_in_transaction_block(caller_method) # do not log errors and retry
347
347
  try_count = try_count + 1 # methods within a transaction
@@ -364,7 +364,7 @@ module PGx
364
364
  def error_handlers(pgerr, caller_method, args)
365
365
  begin
366
366
  state = pgerr.result.error_field(PG::Result::PG_DIAG_SQLSTATE)
367
- rescue PGError => e
367
+ rescue PG::Error => e
368
368
  return # just return if we can't get the state; lost connection?
369
369
  end
370
370
 
@@ -399,7 +399,7 @@ module PGx
399
399
  def sql_retriable?(pgerr, try_count)
400
400
  begin
401
401
  state = pgerr.result.error_field(PG::Result::PG_DIAG_SQLSTATE)
402
- rescue PGError => e
402
+ rescue PG::Error => e
403
403
  return true # retry if we can't get the state; lost connection?
404
404
  end
405
405
 
@@ -422,7 +422,7 @@ module PGx
422
422
  PGx.const_get('ERROR_FIELDCODES').map { |key, value|
423
423
  begin
424
424
  errval = pgerr.result.error_field(value)
425
- rescue PGError => e
425
+ rescue PG::Error => e
426
426
  errval = '?'
427
427
  end
428
428
  %Q{#{key}=#{errval}}
@@ -433,7 +433,7 @@ module PGx
433
433
  def get_error_message(pgerr)
434
434
  begin
435
435
  errval = pgerr.result.error_message
436
- rescue PGError => e
436
+ rescue PG::Error => e
437
437
  errval = '?'
438
438
  end
439
439
  errval.chomp
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiriakos Georgiou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-10 00:00:00.000000000 Z
11
+ date: 2018-09-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  A pure ruby "thin" extension of pg that provides logging,
@@ -39,9 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  version: '0'
40
40
  requirements: []
41
41
  rubyforge_project:
42
- rubygems_version: 2.4.5.1
42
+ rubygems_version: 2.5.2.1
43
43
  signing_key:
44
44
  specification_version: 4
45
45
  summary: A thin extension of pg
46
46
  test_files: []
47
- has_rdoc: