Exception: LeanPool::ResourceError

Inherits:
Error
  • Object
show all
Defined in:
lib/lean_pool/errors.rb

Overview

Raised when resource initialization fails.

This error is raised when the resource initializer block raises an exception during resource creation. The original error is preserved and can be accessed via the cause attribute.

Examples:

Handling resource errors

begin
  pool.checkout { |r| r.operation }
rescue LeanPool::ResourceError => e
  puts "Failed to create resource: #{e.message}"
  puts "Original error: #{e.cause}"
end

Since:

  • 0.1.0