src.ctf.fs: improve `metadata-info` query error message with non-existent metadata...
[babeltrace.git] / src / plugins / ctf / fs-src / metadata.cpp
index f428c5e02ff23c7806300538d1c87538a85c6264..0681b6f2d0900ef6088f99b3de04468c5058710d 100644 (file)
@@ -24,7 +24,8 @@
 #include "metadata.hpp"
 #include "../common/metadata/decoder.hpp"
 
-FILE *ctf_fs_metadata_open_file(const char *trace_path)
+FILE *ctf_fs_metadata_open_file(const char *trace_path, bt_logging_level log_level,
+                                bt_self_component_class *comp_class)
 {
     GString *metadata_path;
     FILE *fp = NULL;
@@ -36,7 +37,13 @@ FILE *ctf_fs_metadata_open_file(const char *trace_path)
 
     g_string_append(metadata_path, G_DIR_SEPARATOR_S CTF_FS_METADATA_FILENAME);
     fp = fopen(metadata_path->str, "rb");
+    if (!fp) {
+        BT_COMP_CLASS_LOGE_APPEND_CAUSE_ERRNO(comp_class, "Failed to open metadata file",
+                                              ": path=\"%s\"", metadata_path->str);
+    }
+
     g_string_free(metadata_path, TRUE);
+
 end:
     return fp;
 }
This page took 0.025051 seconds and 4 git commands to generate.