From 3dd357a4760cc041c8ca02daf217a7e079a4c3e3 Mon Sep 17 00:00:00 2001
From: payno <payno@linazimov.esrf.fr>
Date: Tue, 2 Feb 2021 11:39:30 +0100
Subject: [PATCH] [hdf5file] check if file exists prior to iterate opening on
 it

---
 est/thirdparty/silx/hdf5file.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/est/thirdparty/silx/hdf5file.py b/est/thirdparty/silx/hdf5file.py
index 099173ff..dc93a8fc 100644
--- a/est/thirdparty/silx/hdf5file.py
+++ b/est/thirdparty/silx/hdf5file.py
@@ -197,6 +197,11 @@ def retry_get_data(timeout=None):
 
     def decorator(method):
         def wrapper(url, *args, **kw):
+            if not os.path.exists(url.file_path()):
+                raise OSError(
+                    "Unable to open file: {}. Does not exist."
+                    "".format(url.file_path())
+                )
             os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
             t0 = time.time()
             while True:
-- 
GitLab