<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <filename>COPYING</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@
 #include &lt;boost/filesystem/fstream.hpp&gt;
 #include &lt;boost/filesystem/convenience.hpp&gt;
 #include &lt;boost/tokenizer.hpp&gt;
+#include &lt;iostream&gt;
 
 #include &lt;cctype&gt;
 
@@ -62,13 +63,17 @@ extern int cataparse();
 
 void cataerror(const char *err) {
 	// XXX: we may leak here - memory pools?
-	throw creaturesException(err);
+	throw catalogueException(err);
+}
+void catalogueParseError(int lineno) {
+	std::ostringstream oss;
+	oss &lt;&lt; &quot;Catalogue parse error at line &quot; &lt;&lt; lineno &lt;&lt; std::endl;
+	
+	throw catalogueException(oss.str());
 }
 
 std::istream &amp;operator &gt;&gt; (std::istream &amp;s, Catalogue &amp;c) {
 	catalogueFlexLexer lex(&amp;s);
-	assert(!catalexer);
-	assert(!parsing_cat);
 	catalexer = &amp;lex;
 	parsing_cat = &amp;c;
 			
@@ -91,9 +96,11 @@ void Catalogue::initFrom(fs::path path) {
 	std::cout &lt;&lt; &quot;Catalogue is reading &quot; &lt;&lt; path.native_directory_string() &lt;&lt; std::endl;
 
 	fs::directory_iterator end;
+	std::string file;
 	for (fs::directory_iterator i(path); i != end; ++i) {
 		try {
 			if ((!fs::is_directory(*i)) &amp;&amp; (fs::extension(*i) == &quot;.catalogue&quot;)) {
+				file = (*i).string();
 				std::string x = fs::basename(*i);
 				// TODO: '-en-GB' exists too, this doesn't work for that
 				if ((x.size() &gt; 3) &amp;&amp; (x[x.size() - 3] == '-')) {
@@ -104,7 +111,11 @@ void Catalogue::initFrom(fs::path path) {
 				fs::ifstream f(*i);
 				f &gt;&gt; *this;
 			}
-		} catch (const std::exception &amp;ex) {
+		}
+		catch (const catalogueException &amp;ex) {
+			std::cerr &lt;&lt; &quot;Error reading catalogue file &quot; &lt;&lt; file &lt;&lt; &quot;:&quot; &lt;&lt; std::endl &lt;&lt; '\t' &lt;&lt; ex.what() &lt;&lt; std::endl;
+		}
+		catch (const std::exception &amp;ex) {
 			std::cerr &lt;&lt; &quot;directory_iterator died on '&quot; &lt;&lt; i-&gt;leaf() &lt;&lt; &quot;' with &quot; &lt;&lt; ex.what() &lt;&lt; std::endl;
 		}
 	}	</diff>
      <filename>Catalogue.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,15 @@
 #include &lt;istream&gt;
 #include &lt;boost/filesystem/path.hpp&gt;
 #include &lt;list&gt;
+#include &quot;exceptions.h&quot;
+
+class catalogueException : public creaturesException {
+	public:
+		catalogueException(const char *s) throw()
+			: creaturesException(s) {}
+		catalogueException(const std::string &amp;s) throw()
+			: creaturesException(s) {}
+};	
 
 class Catalogue {
 //protected:</diff>
      <filename>Catalogue.h</filename>
    </modified>
    <modified>
      <filename>SDLMain.m</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,10 @@
     #include &quot;Catalogue.h&quot;
     #include &lt;cstring&gt;
     #include &quot;catalogue.tab.hpp&quot;
+    #include &quot;openc2e.h&quot;
     static std::string cat_str;
+
+    extern void catalogueParseError(int lineno);
 %%
 \#[^\n\r]*[\n\r]*   // comment
 \*[^\n\r]*[\n\r]*   // comment
@@ -14,7 +17,10 @@ ARRAY               return CTOK_ARRAY;
 OVERRIDE            return CTOK_OVERRIDE;
 [0-9]+              { catalval.number = atoi(yytext); return CTOK_INT; }
 \&quot;                  cat_str = &quot;&quot;; BEGIN(CAT_STRING);
+[ \t\n\r]           // yum, whitespace
+
 &lt;CAT_STRING&gt;\\.     cat_str += catalogue_descape(yytext[1]);
 &lt;CAT_STRING&gt;\&quot;      BEGIN(INITIAL); catalval.string = new std::string(cat_str); return CTOK_STR;
 &lt;CAT_STRING&gt;.       cat_str += yytext[0];
-[ \t\n\r]           // yum, whitespace
+
+.                   catalogueParseError(yylineno);</diff>
      <filename>catalogue.l</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cc3b5608314840cc6969e4851addaa56d6c2ea09</id>
    </parent>
  </parents>
  <author>
    <name>Bryan Donlan</name>
    <email>bdonlan@gmail.com</email>
  </author>
  <url>http://github.com/ccdevnet/openc2e/commit/0adf41e234e6e7ec06e742eba2914890fa035542</url>
  <id>0adf41e234e6e7ec06e742eba2914890fa035542</id>
  <committed-date>2005-12-28T15:18:26-08:00</committed-date>
  <authored-date>2005-12-28T15:18:26-08:00</authored-date>
  <message>* Remove spurious svn:executable properties
* Make catalogue parse errors throw a catalogueException instead of aborting</message>
  <tree>ede59d329c55f8bc0c55ac35f785078a366260ea</tree>
  <committer>
    <name>Bryan Donlan</name>
    <email>bdonlan@gmail.com</email>
  </committer>
</commit>
