summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Gilbert <jacob.gilbert@protonmail.com>2021-02-14 20:34:43 -0800
committermormj <34754695+mormj@users.noreply.github.com>2021-02-15 06:43:57 -0500
commit59ff4446b8fc4299c432b570885484633c6f3f30 (patch)
tree724431c17c607003341733fd8a3f260d10f51b1c
parentec3d116546aa9710b324b1713cea058d80c906a8 (diff)
gr-utils: improve usefulness of blocktool exceptions
When binding blocks using 'gr_modtool bind' if a file is missing a fairly useless error is now printed that 'file does not exist'. This actually prints the file that was attempted to be accessed Signed-off-by: Jacob Gilbert <jacob.gilbert@protonmail.com>
-rw-r--r--gr-utils/blocktool/core/parseheader.py2
-rw-r--r--gr-utils/blocktool/core/parseheader_generic.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/gr-utils/blocktool/core/parseheader.py b/gr-utils/blocktool/core/parseheader.py
index 5665ef990a..a8ef6dadab 100644
--- a/gr-utils/blocktool/core/parseheader.py
+++ b/gr-utils/blocktool/core/parseheader.py
@@ -56,7 +56,7 @@ class BlockHeaderParser(BlockTool):
if (include_paths):
self.include_paths = [p.strip() for p in include_paths.split(',')]
if not os.path.isfile(file_path):
- raise BlockToolException('file does not exist')
+ raise BlockToolException('file', file_path, 'does not exist')
file_path = os.path.abspath(file_path)
self.target_file = file_path
self.initialize()
diff --git a/gr-utils/blocktool/core/parseheader_generic.py b/gr-utils/blocktool/core/parseheader_generic.py
index e42142d36b..b62f639e0f 100644
--- a/gr-utils/blocktool/core/parseheader_generic.py
+++ b/gr-utils/blocktool/core/parseheader_generic.py
@@ -59,7 +59,7 @@ class GenericHeaderParser(BlockTool):
if (include_paths):
self.include_paths = [p.strip() for p in include_paths.split(',')]
if not os.path.isfile(file_path):
- raise BlockToolException('file does not exist')
+ raise BlockToolException('file', file_path, 'does not exist')
file_path = os.path.abspath(file_path)
self.target_file = file_path