Skip to content
Snippets Groups Projects
Commit d2a65631 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[data] Improve CachedDataSink error messages

If the opening of the cache file fails, print an error
message to know where to look at.
parent 1411b833
No related branches found
No related tags found
1 merge request!66Improve CachedDataSink error messages
Pipeline #36515 passed
......@@ -935,8 +935,15 @@ class CachedDataSink(DataSink):
try:
self.data_file = open(self.filename, "wb")
self.index_file = open(self.filename.replace(".data", ".index"), "wt")
except Exception:
except Exception as e:
logger.error("Failed to open data file {}: {}".format(self.filename, e))
return False
try:
index_filename = self.filename.replace(".data", ".index")
self.index_file = open(index_filename, "wt")
except Exception as e:
logger.error("Failed to open index file {}: {}".format(index_filename, e))
return False
# Write the dataformat
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment