From 7832f271633de957c6a0dcbc60bc7418c83895d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lorenz=20H=C3=BCdepohl?= <lorenz.huedepohl@rzg.mpg.de>
Date: Fri, 11 Jan 2019 13:55:10 +0100
Subject: [PATCH] Better error messages for missing attributes

---
 mpcdf_common.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mpcdf_common.py b/mpcdf_common.py
index 20f2b67..f7cbf86 100644
--- a/mpcdf_common.py
+++ b/mpcdf_common.py
@@ -190,7 +190,9 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
         try:
             return get_attribute_values(api_url, project, package, "MPCDF:" + attribute, with_project=with_project)
         except UnsetAttributeException:
-            print("ERROR: Attribute MPCDF:" + attribute + " is not set, aborting here", file=sys.stderr)
+            print("ERROR: Attribute MPCDF:" + attribute + " is not set for "
+                  + ("package '{0}'".format(package) if package else "project '{0}'".format(project))
+                  + ", aborting here", file=sys.stderr)
             raise SystemExit(1)
 
     compilers = try_get_attribute(package, "compiler_modules", with_project=True)
-- 
GitLab