Skip to content

Commit

Permalink
Add try-with-resources to ErrorManager HttpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-1000 committed Jul 20, 2024
1 parent ca58681 commit 258a994
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ private static void dispatchError(CrashReport report)

LOG.warn("Posting error to Rollbar");

try
try (var httpclient = HttpClient.newBuilder().connectTimeout(Duration.ofMinutes(1)).build())
{
var httpclient = HttpClient.newBuilder().connectTimeout(Duration.ofMinutes(1)).build();

LOG.warn("Executing request to Rollbar");

var response = httpclient.send(HttpRequest.newBuilder()
Expand Down

0 comments on commit 258a994

Please sign in to comment.