diff --git a/getexp b/getexp
index b9b2bbf83d6df6e64a60f5de0261859096c8108d..3d76660ce4fc25b781219c857f0f39ec6b5fb6da 100755
--- a/getexp
+++ b/getexp
@@ -95,7 +95,7 @@ try:
                        dict([x.split('=', 1) for x in args.assigns]),
                        config_roots, getexp=args.getexp)
 except ExpConfigError as error:
-    die(error.message, status=2)
+    die(error, status=2)
 
 exp_dir_names = []
 if 'MODEL_DIR' in config:
@@ -115,7 +115,7 @@ elif args.key:
             else:
                 print(get_value(config, key))
     except KeyError as error:
-        die("invalid config name '{0}'".format(error.message))
+        die("invalid config name %s", error)
 elif args.verbose >= 2:
     config.indent_type = '  '
     lines = io.BytesIO()