diff options
author | Ola Aunrønning <olaa@verizonmedia.com> | 2019-09-09 11:39:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 11:39:47 +0200 |
commit | a3f58804f652a5445e60a47575ef4ad6a1f90751 (patch) | |
tree | e3c4f655a8b851ac933b098d7b7f779ac51f2b02 | |
parent | 6648f89d562f732972df42214e7b0895edf04659 (diff) | |
parent | 2e6e8c8d2fee64e1fd02507b9e250467f1f34089 (diff) |
Merge pull request #10559 from vespa-engine/olaa/consider-path-does-not-exist
Handle NoSuchFileException
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/node/CoredumpMetricGatherer.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/node/CoredumpMetricGatherer.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/node/CoredumpMetricGatherer.java index 91e7fbbc0b5..09f0bbe16a6 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/node/CoredumpMetricGatherer.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/node/CoredumpMetricGatherer.java @@ -8,6 +8,7 @@ import com.yahoo.vespa.defaults.Defaults; import java.io.IOException; import java.io.UncheckedIOException; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.time.Instant; import java.util.Set; @@ -38,6 +39,8 @@ public class CoredumpMetricGatherer { return (int) fileWrapper.walkTree(COREDUMP_PATH) .filter(fileWrapper::isRegularFile) .count(); + } catch (NoSuchFileException e) { + return 0; } catch (IOException e) { throw new UncheckedIOException(e); } |