Skip to content

Commit

Permalink
Reduce exception construction (#538)
Browse files Browse the repository at this point in the history
Create an exception lazily only when necessary.
  • Loading branch information
Robert Macaulay authored and mikkokar committed Nov 25, 2019
1 parent 6eebf58 commit 70d732f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Publisher<Connection> borrowConnection() {
}
}).timeout(
Duration.ofMillis(poolSettings.pendingConnectionTimeoutMillis()),
Mono.error(new MaxPendingConnectionTimeoutException(origin, connectionSettings.connectTimeoutMillis())));
Mono.error(() -> new MaxPendingConnectionTimeoutException(origin, connectionSettings.connectTimeoutMillis())));
}

private void newConnection() {
Expand Down

0 comments on commit 70d732f

Please sign in to comment.