From ae9fd9fe96bad6e03b16dc068806f7408df32290 Mon Sep 17 00:00:00 2001 From: Greg Caporaso Date: Fri, 15 Jan 2016 14:38:09 -0700 Subject: [PATCH] slightly improved error message, partially addresses #1 --- biab/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/biab/util.py b/biab/util.py index 1ebbd0c..9be3c4b 100644 --- a/biab/util.py +++ b/biab/util.py @@ -63,7 +63,10 @@ def handle_starttag(self, tag, attrs): raise Exception("Invalid ID for section") def get_id(self): - return self._ID + try: + return self._ID + except AttributeError: + raise ValueError("A section is missing its ID.") class Node(object):