Add exception cause support to PoolResourceLost and ConnectionLost (#199)

constructors
This commit is contained in:
Lachlan Dowding 2023-11-30 22:36:00 +10:00 committed by GitHub
parent d3dd978e24
commit 06df272740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,8 @@ module DB
class PoolResourceLost(T) < Error
getter resource : T
def initialize(@resource : T)
def initialize(@resource : T, cause : Exception? = nil)
super(cause: cause)
@resource.close
end
end