Exception: Pod4::PoolTimeout

Inherits:
Pod4Error
  • Object
show all
Defined in:
lib/pod4/errors.rb

Overview

Raised if ConnectionPool times out waiting for a client to become free. This can only happen if your pool has a maximum number of clients set, and a max_wait value set; and if all the clients are currently in use.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, field = nil) ⇒ PoolTimeout

Returns a new instance of PoolTimeout.



109
110
111
112
# File 'lib/pod4/errors.rb', line 109

def initialize(message=nil, field=nil)
  super(message || $! && $!.message)
  @field = field.to_s.to_sym
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



103
104
105
# File 'lib/pod4/errors.rb', line 103

def field
  @field
end

Class Method Details

.from_alert(alert) ⇒ Object



105
106
107
# File 'lib/pod4/errors.rb', line 105

def self.from_alert(alert)
  self.new(alert.message, alert.field)
end