Skip to content

Commit

Permalink
Add exception cause support to PoolResourceLost and ConnectionLost (
Browse files Browse the repository at this point in the history
#199)

constructors
  • Loading branch information
lachlan authored Nov 30, 2023
1 parent d3dd978 commit 06df272
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/db/error.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06df272

Please sign in to comment.