Skip to content

Commit

Permalink
Add some error handling, reporting missing arguments.
Browse files Browse the repository at this point in the history
This partly addresses issue okfn#14.
  • Loading branch information
petterreinholdtsen committed Dec 30, 2015
1 parent a2c8392 commit 203ba30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pd/pdcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
print ", ".join(itms)

else:
if not args.instance:
print "error: No -i argument provided, did you forget to specify input file?"
sys.exit(1)

if args.instance.startswith("http"):
args.mode = "url"
Expand Down Expand Up @@ -79,6 +82,9 @@
else:
a.query(args.query)
print a.get_result()
else:
print "error: unable to process input, as some data files are missing"
sys.exit(1)

if args.mode == "url":
os.remove(args.instance)
Expand Down

0 comments on commit 203ba30

Please sign in to comment.