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
1 changed files with 2 additions and 1 deletions

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