Skip to content

Commit

Permalink
add try-catch to ensure release of http resource
Browse files Browse the repository at this point in the history
  • Loading branch information
shokakucarrier committed Feb 5, 2025
1 parent a62337f commit 9282f9a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ public TrackingIdsDTO getTrackingIds( final String trackingType )
public void deleteFilesFromStoreByTrackingID( final BatchDeleteRequest request )
throws IndyClientException
{
http.postRaw( UrlUtils.buildUrl( "/folo/admin/batch/delete" ), request );
String url = UrlUtils.buildUrl("/folo/admin/batch/delete");
try ( HttpResources resources = http.postRaw(url, request) )
{
if (resources.getStatusCode() != HttpStatus.SC_OK)
{
throw new IndyClientException( resources.getStatusCode(), "Error deleting files: %s",
new IndyResponseErrorDetails( resources.getResponse() ) );
}
}
}

@Deprecated
Expand Down

0 comments on commit 9282f9a

Please sign in to comment.