summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-11 15:40:34 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-11 15:40:34 +0100
commit8b092e0124f8a06337ffaa44a4d9d04f6cb90b5b (patch)
tree1fee9b5cd4757bed04afbf9225286d09e6231e0d /morphlib/plugins
parent627c9921bc4fe0541022e0589f9d2826d850effc (diff)
downloadmorph-8b092e0124f8a06337ffaa44a4d9d04f6cb90b5b.tar.gz
Handle ValueErrors from JSON library
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index b14a9ef7..c7681030 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -266,7 +266,13 @@ class BranchAndMergePlugin(cliapp.Plugin):
if ref is not None:
msg += ' at ref %s' % ref
raise cliapp.AppException(msg)
- morphology = morphlib.morph2.Morphology(text)
+
+ try:
+ morphology = morphlib.morph2.Morphology(text)
+ except ValueError as e:
+ raise morphlib.Error("Error parsing %s: %s" %
+ (filename, str(e)))
+
return morphology
def reset_work_tree_safe(self, repo_dir):