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 7a00e93
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ public TrackingIdsDTO getTrackingIds( final String trackingType )
public void deleteFilesFromStoreByTrackingID( final BatchDeleteRequest request )
throws IndyClientException
{
http.postRaw( UrlUtils.buildUrl( "/folo/admin/batch/delete" ), request );
final String url = UrlUtils.buildUrl("/folo/admin/batch/delete");
try ( HttpResources resources = http.postRaw( url, request ) )
{
// Do something with the response?
}
catch (final IndyClientException e)
{
throw new IndyClientException( resources.getStatusCode(), "Error deleting files: %s",
new IndyResponseErrorDetails( resources.getResponse() ) );
}
}

@Deprecated
Expand Down

0 comments on commit 7a00e93

Please sign in to comment.