mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Add exception cause support to PoolResourceLost
and ConnectionLost
(#199)
constructors
This commit is contained in:
parent
d3dd978e24
commit
06df272740
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue