From 64348b09ab7422d9f7f39ab05f8fe6dc7455a2a0 Mon Sep 17 00:00:00 2001 From: Chris Bradley Date: Thu, 9 Jan 2025 17:22:47 +0000 Subject: [PATCH] Check if file exists in dump-info tool --- src/tools/gribjump-dump-info.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/gribjump-dump-info.cc b/src/tools/gribjump-dump-info.cc index 5ef86a1..87804cf 100644 --- a/src/tools/gribjump-dump-info.cc +++ b/src/tools/gribjump-dump-info.cc @@ -39,6 +39,9 @@ void DumpInfo::usage(const std::string &tool) const { void DumpInfo::execute(const eckit::option::CmdArgs &args) { for (size_t i = 0; i < args.count(); i++) { eckit::PathName file(args(i)); + if (!file.exists()) { + throw eckit::UserError("File not found", file); + } IndexFile index = IndexFile(file); index.print(std::cout); }