[PATCH 1/5] nmbug-status: Avoid hard-coded filename in error message

Subject: [PATCH 1/5] nmbug-status: Avoid hard-coded filename in error message

Date: Fri, 1 Jan 2016 22:08:01 -0800

To: notmuch@notmuchmail.org

Cc: David Bremner, Tomi Ollila, Jani Nikula, Carl Worth, W. Trevor King

From: W. Trevor King


We already have a 'filename' variable with the name, so stay DRY and
use that variable here.

Also fix a missing-whitespace error from bed8b674 (nmbug-status:
Clarify errors for illegible configs, 2014-05-10), wrapping on the
sentence to match similar error-generation earlier in this function.
---
 devel/nmbug/nmbug-status | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
index b36b6ad..22e3b5b 100755
--- a/devel/nmbug/nmbug-status
+++ b/devel/nmbug/nmbug-status
@@ -109,9 +109,9 @@ def read_config(path=None, encoding=None):
         status = p.wait()
         if status != 0:
             raise ConfigError(
-                ("Missing status-config.json in branch '{branch}' of"
-                 '{nmbgit}.  Add the file or explicitly set --config.'
-                ).format(branch=branch, nmbgit=nmbhome))
+                ("Missing {filename} in branch '{branch}' of {nmbgit}.  "
+                 'Add the file or explicitly set --config.'
+                ).format(filename=filename, branch=branch, nmbgit=nmbhome))
 
     config_json = config_bytes.decode(encoding)
     try:
-- 
2.1.0.60.g85f0837


Thread: