From 97a0d15ca2185197c644a27d2aedc22a7a06ca78 Mon Sep 17 00:00:00 2001 From: Fabien Benureau Date: Tue, 20 Jan 2015 11:04:17 +0100 Subject: [PATCH] fix graceful exit when DOI is not recognized --- pubs/commands/add_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubs/commands/add_cmd.py b/pubs/commands/add_cmd.py index a8a5e06..140c688 100644 --- a/pubs/commands/add_cmd.py +++ b/pubs/commands/add_cmd.py @@ -75,7 +75,8 @@ def command(args): bibdata_raw = apis.doi2bibtex(args.doi) bibdata = rp.databroker.verify(bibdata_raw) if bibdata is None: - ui.error('invalid doi {} or unable to retreive bibfile.'.format(doi)) + ui.error('invalid doi {} or unable to retreive bibfile.'.format(args.doi)) + ui.exit(1) # TODO distinguish between cases, offer to open the error page in a webbrowser. # TODO offer to confirm/change citekey else: