Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 290)
+++ lemon/lgf_reader.h	(revision 291)
@@ -517,5 +517,5 @@
         _use_nodes(false), _use_arcs(false),
         _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -529,5 +529,5 @@
         _use_nodes(false), _use_arcs(false),
         _skip_nodes(false), _skip_arcs(false) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -880,5 +880,5 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _node_maps[i].first;
+            msg << "Map not found: " << _node_maps[i].first;
             throw FormatError(msg.str());
           }
@@ -909,5 +909,5 @@
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Node n;
@@ -918,5 +918,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found in file");
+            throw FormatError("Label map not found");
           typename std::map<std::string, Node>::iterator it =
             _node_index.find(tokens[label_index]);
@@ -973,5 +973,5 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _arc_maps[i].first;
+            msg << "Map not found: " << _arc_maps[i].first;
             throw FormatError(msg.str());
           }
@@ -1011,5 +1011,5 @@
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Arc a;
@@ -1039,5 +1039,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found in file");
+            throw FormatError("Label map not found");
           typename std::map<std::string, Arc>::iterator it =
             _arc_index.find(tokens[label_index]);
@@ -1074,5 +1074,5 @@
           throw FormatError("Attribute value not found");
         if (line >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         {
@@ -1080,5 +1080,5 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute " << attr;
+            msg << "Multiple occurence of attribute: " << attr;
             throw FormatError(msg.str());
           }
@@ -1102,5 +1102,5 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found in file: " << it->first;
+          msg << "Attribute not found: " << it->first;
           throw FormatError(msg.str());
         }
@@ -1118,7 +1118,4 @@
     void run() {
       LEMON_ASSERT(_is != 0, "This reader assigned to an other reader");
-      if (!*_is) {
-        throw FormatError("Cannot find file");
-      }
 
       bool nodes_done = _skip_nodes;
@@ -1139,5 +1136,5 @@
 
           if (line >> c)
-            throw FormatError("Extra character on the end of line");
+            throw FormatError("Extra character at the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -1309,5 +1306,5 @@
         _use_nodes(false), _use_edges(false),
         _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -1321,5 +1318,5 @@
         _use_nodes(false), _use_edges(false),
         _skip_nodes(false), _skip_edges(false) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -1716,5 +1713,5 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _node_maps[i].first;
+            msg << "Map not found: " << _node_maps[i].first;
             throw FormatError(msg.str());
           }
@@ -1745,5 +1742,5 @@
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Node n;
@@ -1754,5 +1751,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found in file");
+            throw FormatError("Label map not found");
           typename std::map<std::string, Node>::iterator it =
             _node_index.find(tokens[label_index]);
@@ -1809,5 +1806,5 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _edge_maps[i].first;
+            msg << "Map not found: " << _edge_maps[i].first;
             throw FormatError(msg.str());
           }
@@ -1847,5 +1844,5 @@
         }
         if (line >> std::ws >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Edge e;
@@ -1875,5 +1872,5 @@
         } else {
           if (label_index == -1)
-            throw FormatError("Label map not found in file");
+            throw FormatError("Label map not found");
           typename std::map<std::string, Edge>::iterator it =
             _edge_index.find(tokens[label_index]);
@@ -1910,5 +1907,5 @@
           throw FormatError("Attribute value not found");
         if (line >> c)
-          throw FormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         {
@@ -1916,5 +1913,5 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute " << attr;
+            msg << "Multiple occurence of attribute: " << attr;
             throw FormatError(msg.str());
           }
@@ -1938,5 +1935,5 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found in file: " << it->first;
+          msg << "Attribute not found: " << it->first;
           throw FormatError(msg.str());
         }
@@ -1973,5 +1970,5 @@
 
           if (line >> c)
-            throw FormatError("Extra character on the end of line");
+            throw FormatError("Extra character at the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -2096,5 +2093,5 @@
       : _is(new std::ifstream(fn.c_str())), local_is(true),
         _filename(fn) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -2105,5 +2102,5 @@
       : _is(new std::ifstream(fn)), local_is(true),
         _filename(fn) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -2262,9 +2259,9 @@
 
           if (line >> c)
-            throw FormatError("Extra character on the end of line");
+            throw FormatError("Extra character at the end of line");
 
           if (extra_sections.find(section) != extra_sections.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of section " << section;
+            msg << "Multiple occurence of section: " << section;
             throw FormatError(msg.str());
           }
@@ -2388,5 +2385,5 @@
     LgfContents(const std::string& fn)
       : _is(new std::ifstream(fn.c_str())), local_is(true) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
@@ -2397,5 +2394,5 @@
     LgfContents(const char* fn)
       : _is(new std::ifstream(fn)), local_is(true) {
-      if (!(*_is)) throw IoError(fn, "Cannot open file");
+      if (!(*_is)) throw IoError("Cannot open file", fn);
     }
 
