From c51fe59e2f1fb66cc18acf829bd50d11cddb2524 Mon Sep 17 00:00:00 2001 From: Mohanned Anwar <92345336+Muhanned-Anwar@users.noreply.github.com> Date: Wed, 5 Apr 2023 10:13:47 +0300 Subject: [PATCH] Update NativeUtils.java Catch the rest of the exceptions --- ann/src/main/java/com/twitter/ann/faiss/NativeUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ann/src/main/java/com/twitter/ann/faiss/NativeUtils.java b/ann/src/main/java/com/twitter/ann/faiss/NativeUtils.java index 56cf79b1f..1cc0af0b0 100644 --- a/ann/src/main/java/com/twitter/ann/faiss/NativeUtils.java +++ b/ann/src/main/java/com/twitter/ann/faiss/NativeUtils.java @@ -45,6 +45,9 @@ public final class NativeUtils { } catch (NullPointerException e) { temp.delete(); throw new FileNotFoundException("File " + path + " was not found inside JAR."); + } catch (Exception e) { + file.delete(); + throw e; } return temp;