Skip to content

Commit

Permalink
Merge pull request #304 from nextstrain/refine_exception
Browse files Browse the repository at this point in the history
Handle Missing/Empty file Error in Refine
  • Loading branch information
emmahodcroft committed Jul 1, 2019
2 parents 33ad4ef + 99f87fa commit 1e37b86
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions augur/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ def run(args):
T = Phylo.read(args.tree, fmt)
node_data['input_tree'] = args.tree
break
except:
pass
except Exception as error:
print("\n\nERROR: reading tree from %s failed: %s" % (args.tree, error))
return 1
if T is None:
print("ERROR: reading tree from %s failed."%args.tree)
print("\n\nERROR: reading tree from %s failed."%args.tree)
return 1

if not args.alignment:
Expand Down

0 comments on commit 1e37b86

Please sign in to comment.