Better error handling for HG
Merge pull request #23 from rnc/master

Better error handling for HG