Skip to content

Commit

Permalink
Merge pull request #816 from nextstrain/feat/informative-error
Browse files Browse the repository at this point in the history
feat: improve error handling with hint
  • Loading branch information
corneliusroemer authored Dec 16, 2021
2 parents a3a79ca + 3d1cbf8 commit 6585427
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion augur/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ def run(args):
elif args.root in ['least-squares', 'min_dev', 'oldest']:
raise TypeError("The rooting option '%s' is only available when inferring a timetree. Please specify an explicit outgroup."%args.root)
else:
T.root_with_outgroup(args.root)
try:
T.root_with_outgroup(args.root)
except ValueError as err:
raise ValueError(f"HINT: This error may be because your specified root with name '{args.root}' was not found in your alignment file") from err

tt = TreeAnc(tree=T, aln=aln, ref=ref, gtr='JC69', verbose=1)

Expand Down

0 comments on commit 6585427

Please sign in to comment.