Skip to content

Commit

Permalink
close conn if auth fails (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 authored Sep 23, 2019
1 parent 74d49fd commit 2cdd00a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/PostgresKit/PostgresConnectionSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public struct PostgresConnectionSource: ConnectionPoolSource {
username: self.configuration.username,
database: self.configuration.database,
password: self.configuration.password
).map { conn }
).flatMapError { error in
return conn.close()
.flatMapThrowing { throw error }
}.map { conn }
}
}
}
Expand Down

0 comments on commit 2cdd00a

Please sign in to comment.