]> git.notmuchmail.org Git - notmuch/commitdiff
nmbug-status: Avoid hard-coded filename in error message
authorW. Trevor King <wking@tremily.us>
Sat, 2 Jan 2016 06:08:01 +0000 (22:08 -0800)
committerDavid Bremner <david@tethera.net>
Thu, 7 Jan 2016 13:15:35 +0000 (09:15 -0400)
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

index b36b6ad33859d7f8ba4b59381c7d147385878a9d..22e3b5b5e65350a5c75de7c2ef2f4e79b9519272 100755 (executable)
@@ -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: