diff options
| author | W. Trevor King <wking@tremily.us> | 2014-05-10 12:16:38 -0700 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-15 09:28:15 +0100 |
| commit | bed8b6743d1cfffe8193c6b3571ef460b92e4ade (patch) | |
| tree | 733dd25328f7755d78a51ab7faa41f1bb87bc137 /lib | |
| parent | 6d44e5ac4743f618513c9a080733d91afa683f16 (diff) | |
nmbug-status: Clarify errors for illegible configs
Carl Worth pointed out that errors like:
$ ./nmbug-status
fatal: Not a git repository: '/home/cworth/.nmbug'
fatal: Not a git repository: '/home/cworth/.nmbug'
Traceback (most recent call last):
File "./nmbug-status", line 254, in <module>
config = read_config(path=args.config)
File "./nmbug-status", line 73, in read_config
return json.load(fp)
File "/usr/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
are not particularly clear. With this commit, we'll get output like:
$ ./nmbug-status
fatal: Not a git repository: '/home/wking/.nmbug'
No local branch 'config' in /home/wking/.nmbug. Checkout a local
config branch or explicitly set --config.
which is much more accessible. I've also added user-friendly messages
for a number of other config-parsing errors.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
