Index: demo/lgf_demo.cc
===================================================================
--- demo/lgf_demo.cc	(revision 209)
+++ demo/lgf_demo.cc	(revision 290)
@@ -50,5 +50,5 @@
       node("target", t).             // read 'target' node to t
       run();
-  } catch (DataFormatError& error) { // check if there was any error
+  } catch (Exception& error) { // check if there was any error
     std::cerr << "Error: " << error.what() << std::endl;
     return -1;
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h	(revision 261)
+++ lemon/arg_parser.h	(revision 290)
@@ -311,6 +311,7 @@
     ///This is the type of the return value of ArgParser::operator[]().
     ///It automatically converts to \c int, \c double, \c bool or
-    ///\c std::string if the type of the option matches, otherwise it
-    ///throws an exception (i.e. it performs runtime type checking).
+    ///\c std::string if the type of the option matches, which is checked
+    ///with an \ref LEMON_ASSERT "assertion" (i.e. it performs runtime
+    ///type checking).
     class RefType
     {
Index: lemon/assert.h
===================================================================
--- lemon/assert.h	(revision 277)
+++ lemon/assert.h	(revision 290)
@@ -109,5 +109,5 @@
 /// \brief Macro for assertion with customizable message
 ///
-/// Macro for assertion with customizable message.  
+/// Macro for assertion with customizable message.
 /// \param exp An expression that must be convertible to \c bool.  If it is \c
 /// false, then an assertion is raised. The concrete behaviour depends on the
Index: lemon/bfs.h
===================================================================
--- lemon/bfs.h	(revision 288)
+++ lemon/bfs.h	(revision 292)
@@ -136,14 +136,4 @@
   class Bfs {
   public:
-    ///\ref Exception for uninitialized parameters.
-
-    ///This error represents problems in the initialization of the
-    ///parameters of the algorithm.
-    class UninitializedParameter : public lemon::UninitializedParameter {
-    public:
-      virtual const char* what() const throw() {
-        return "lemon::Bfs::UninitializedParameter";
-      }
-    };
 
     ///The type of the digraph the algorithm runs on.
@@ -233,5 +223,6 @@
       static PredMap *createPredMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "PredMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -251,5 +242,6 @@
       static DistMap *createDistMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "DistMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -269,5 +261,6 @@
       static ReachedMap *createReachedMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ReachedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -287,5 +280,6 @@
       static ProcessedMap *createProcessedMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ProcessedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -305,4 +299,5 @@
       {
         return new ProcessedMap(g);
+        return 0; // ignore warnings
       }
     };
@@ -1041,5 +1036,4 @@
     bool run(Node s, Node t)
     {
-      if (s==INVALID || t==INVALID) throw UninitializedParameter();
       Bfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
       if (Base::_pred)
@@ -1324,16 +1318,4 @@
   public:
 
-    /// \brief \ref Exception for uninitialized parameters.
-    ///
-    /// This error represents problems in the initialization
-    /// of the parameters of the algorithm.
-    class UninitializedParameter : public lemon::UninitializedParameter {
-    public:
-      virtual const char* what() const throw()
-      {
-        return "lemon::BfsVisit::UninitializedParameter";
-      }
-    };
-
     ///The traits class.
     typedef _Traits Traits;
@@ -1390,5 +1372,6 @@
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &digraph) {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ReachedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
Index: lemon/concepts/heap.h
===================================================================
--- lemon/concepts/heap.h	(revision 220)
+++ lemon/concepts/heap.h	(revision 290)
@@ -130,5 +130,4 @@
       /// Otherwise it inserts the given item with the given priority.
       ///
-      /// It may throw an \ref UnderflowPriorityException.
       /// \param i The item.
       /// \param p The priority.
Index: lemon/dfs.h
===================================================================
--- lemon/dfs.h	(revision 288)
+++ lemon/dfs.h	(revision 292)
@@ -137,14 +137,4 @@
   class Dfs {
   public:
-    ///\ref Exception for uninitialized parameters.
-
-    ///This error represents problems in the initialization of the
-    ///parameters of the algorithm.
-    class UninitializedParameter : public lemon::UninitializedParameter {
-    public:
-      virtual const char* what() const throw() {
-        return "lemon::Dfs::UninitializedParameter";
-      }
-    };
 
     ///The type of the digraph the algorithm runs on.
@@ -233,5 +223,6 @@
       static PredMap *createPredMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "PredMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -251,5 +242,6 @@
       static DistMap *createDistMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "DistMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -269,5 +261,6 @@
       static ReachedMap *createReachedMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ReachedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -287,5 +280,6 @@
       static ProcessedMap *createProcessedMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ProcessedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -975,5 +969,4 @@
     bool run(Node s, Node t)
     {
-      if (s==INVALID || t==INVALID) throw UninitializedParameter();
       Dfs<Digraph,TR> alg(*reinterpret_cast<const Digraph*>(Base::_g));
       if (Base::_pred)
@@ -1271,16 +1264,4 @@
   public:
 
-    /// \brief \ref Exception for uninitialized parameters.
-    ///
-    /// This error represents problems in the initialization
-    /// of the parameters of the algorithm.
-    class UninitializedParameter : public lemon::UninitializedParameter {
-    public:
-      virtual const char* what() const throw()
-      {
-        return "lemon::DfsVisit::UninitializedParameter";
-      }
-    };
-
     ///The traits class.
     typedef _Traits Traits;
@@ -1337,5 +1318,6 @@
       typedef T ReachedMap;
       static ReachedMap *createReachedMap(const Digraph &digraph) {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ReachedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
Index: lemon/dijkstra.h
===================================================================
--- lemon/dijkstra.h	(revision 287)
+++ lemon/dijkstra.h	(revision 290)
@@ -226,14 +226,4 @@
   class Dijkstra {
   public:
-    ///\ref Exception for uninitialized parameters.
-
-    ///This error represents problems in the initialization of the
-    ///parameters of the algorithm.
-    class UninitializedParameter : public lemon::UninitializedParameter {
-    public:
-      virtual const char* what() const throw() {
-        return "lemon::Dijkstra::UninitializedParameter";
-      }
-    };
 
     ///The type of the digraph the algorithm runs on.
@@ -333,5 +323,6 @@
       static PredMap *createPredMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "PredMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -352,5 +343,6 @@
       static DistMap *createDistMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "DistMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -371,5 +363,6 @@
       static ProcessedMap *createProcessedMap(const Digraph &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "ProcessedMap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -409,9 +402,11 @@
       typedef H Heap;
       static HeapCrossRef *createHeapCrossRef(const Digraph &) {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "HeapCrossRef is not initialized");
+        return 0; // ignore warnings
       }
       static Heap *createHeap(HeapCrossRef &)
       {
-        throw UninitializedParameter();
+        LEMON_ASSERT(false, "Heap is not initialized");
+        return 0; // ignore warnings
       }
     };
@@ -1159,5 +1154,4 @@
     void run(Node s)
     {
-      if (s==INVALID) throw UninitializedParameter();
       Dijkstra<Digraph,LengthMap,TR>
         dijk(*reinterpret_cast<const Digraph*>(Base::_g),
@@ -1181,5 +1175,4 @@
     bool run(Node s, Node t)
     {
-      if (s==INVALID || t==INVALID) throw UninitializedParameter();
       Dijkstra<Digraph,LengthMap,TR>
         dijk(*reinterpret_cast<const Digraph*>(Base::_g),
Index: lemon/error.h
===================================================================
--- lemon/error.h	(revision 280)
+++ lemon/error.h	(revision 291)
@@ -36,142 +36,15 @@
   /// @{
 
-  /// \brief Exception safe wrapper class.
-  ///
-  /// Exception safe wrapper class to implement the members of exceptions.
-  template <typename _Type>
-  class ExceptionMember {
-  public:
-    typedef _Type Type;
-
-    ExceptionMember() throw() {
-      try {
-        ptr.reset(new Type());
-      } catch (...) {}
-    }
-
-    ExceptionMember(const Type& type) throw() {
-      try {
-        ptr.reset(new Type());
-        if (ptr.get() == 0) return;
-        *ptr = type;
-      } catch (...) {}
-    }
-
-    ExceptionMember(const ExceptionMember& copy) throw() {
-      try {
-        if (!copy.valid()) return;
-        ptr.reset(new Type());
-        if (ptr.get() == 0) return;
-        *ptr = copy.get();
-      } catch (...) {}
-    }
-
-    ExceptionMember& operator=(const ExceptionMember& copy) throw() {
-      if (ptr.get() == 0) return;
-      try {
-        if (!copy.valid()) return;
-        *ptr = copy.get();
-      } catch (...) {}
-    }
-
-    void set(const Type& type) throw() {
-      if (ptr.get() == 0) return;
-      try {
-        *ptr = type;
-      } catch (...) {}
-    }
-
-    const Type& get() const {
-      return *ptr;
-    }
-
-    bool valid() const throw() {
-      return ptr.get() != 0;
-    }
-
-  private:
-    std::auto_ptr<_Type> ptr;
-  };
-
-  /// Exception-safe convenient error message builder class.
-
-  /// Helper class which provides a convenient ostream-like (operator <<
-  /// based) interface to create a string message. Mostly useful in
-  /// exception classes (therefore the name).
-  class ErrorMessage {
-  protected:
-    ///\e
-
-    mutable std::auto_ptr<std::ostringstream> buf;
-
-    ///\e
-    bool init() throw() {
-      try {
-        buf.reset(new std::ostringstream);
-      }
-      catch(...) {
-        buf.reset();
-      }
-      return buf.get();
-    }
-
-  public:
-
-    ///\e
-    ErrorMessage() throw() { init(); }
-
-    ErrorMessage(const ErrorMessage& em) throw() : buf(em.buf) { }
-
-    ///\e
-    ErrorMessage(const char *msg) throw() {
-      init();
-      *this << msg;
-    }
-
-    ///\e
-    ErrorMessage(const std::string &msg) throw() {
-      init();
-      *this << msg;
-    }
-
-    ///\e
-    template <typename T>
-    ErrorMessage& operator<<(const T &t) throw() {
-      if( ! buf.get() ) return *this;
-
-      try {
-        *buf << t;
-      }
-      catch(...) {
-        buf.reset();
-      }
-      return *this;
-    }
-
-    ///\e
-    const char* message() throw() {
-      if( ! buf.get() ) return 0;
-
-      const char* mes = 0;
-      try {
-        mes = buf->str().c_str();
-      }
-      catch(...) {}
-      return mes;
-    }
-
-  };
-
-  /// Generic exception class.
-
+  /// \brief Generic exception class.
+  ///
   /// Base class for exceptions used in LEMON.
   ///
   class Exception : public std::exception {
   public:
-    ///\e
-    Exception() {}
-    ///\e
+    ///Constructor
+    Exception() throw() {}
+    ///Virtual destructor
     virtual ~Exception() throw() {}
-    ///\e
+    ///A short description of the exception
     virtual const char* what() const throw() {
       return "lemon::Exception";
@@ -179,237 +52,222 @@
   };
 
-  /// One of the two main subclasses of \ref Exception.
-
-  /// Logic errors represent problems in the internal logic of a program;
-  /// in theory, these are preventable, and even detectable before the
-  /// program runs (e.g. violations of class invariants).
-  ///
-  /// A typical example for this is \ref UninitializedParameter.
-  class LogicError : public Exception {
+  /// \brief Input-Output error
+  ///
+  /// This exception is thrown when a file operation cannot be
+  /// succeeded.
+  class IoError : public Exception {
+  protected:
+    std::string _message;
+    std::string _file;
+
+    mutable std::string _what;
   public:
+
+    /// Copy constructor
+    IoError(const IoError &error) throw() : Exception() {
+      message(error._message);
+      file(error._file);
+    }
+
+    /// Constructor
+    explicit IoError(const char *message) throw() {
+      IoError::message(message);
+    }
+
+    /// Constructor
+    explicit IoError(const std::string &message) throw() {
+      IoError::message(message);
+    }
+
+    /// Constructor
+    explicit IoError(const char *message,
+                     const std::string &file) throw() {
+      IoError::message(message);
+      IoError::file(file);
+    }
+
+    /// Constructor
+    explicit IoError(const std::string &message,
+                     const std::string &file) throw() {
+      IoError::message(message);
+      IoError::file(file);
+    }
+
+    /// Virtual destructor
+    virtual ~IoError() throw() {}
+
+    /// Set the error message
+    void message(const char *message) throw() {
+      try {
+        _message = message;
+      } catch (...) {}
+    }
+
+    /// Set the error message
+    void message(const std::string& message) throw() {
+      try {
+        _message = message;
+      } catch (...) {}
+    }
+
+    /// Set the file name
+    void file(const std::string &file) throw() {
+      try {
+        _file = file;
+      } catch (...) {}
+    }
+
+    /// Returns the error message
+    const std::string& message() const throw() {
+      return _message;
+    }
+
+    /// \brief Returns the filename
+    ///
+    /// Returns the filename or an empty string if it was not specified.
+    const std::string& file() const throw() {
+      return _file;
+    }
+
+    /// \brief Returns a short error message
+    ///
+    /// Returns a short error message which contains the message and the
+    /// file name.
     virtual const char* what() const throw() {
-      return "lemon::LogicError";
-    }
-  };
-
-  /// \ref Exception for uninitialized parameters.
-
-  /// This error represents problems in the initialization
-  /// of the parameters of the algorithms.
-  class UninitializedParameter : public LogicError {
-  public:
-    virtual const char* what() const throw() {
-      return "lemon::UninitializedParameter";
-    }
-  };
-
-
-  /// One of the two main subclasses of \ref Exception.
-
-  /// Runtime errors represent problems outside the scope of a program;
-  /// they cannot be easily predicted and can generally only be caught
-  /// as the program executes.
-  class RuntimeError : public Exception {
-  public:
-    virtual const char* what() const throw() {
-      return "lemon::RuntimeError";
-    }
-  };
-
-  ///\e
-  class RangeError : public RuntimeError {
-  public:
-    virtual const char* what() const throw() {
-      return "lemon::RangeError";
-    }
-  };
-
-  ///\e
-  class IoError : public RuntimeError {
-  public:
-    virtual const char* what() const throw() {
-      return "lemon::IoError";
-    }
-  };
-
-  ///\e
-  class DataFormatError : public IoError {
-  protected:
-    ExceptionMember<std::string> _message;
-    ExceptionMember<std::string> _file;
-    int _line;
-
-    mutable ExceptionMember<std::string> _message_holder;
-  public:
-
-    DataFormatError(const DataFormatError &dfe) :
-      IoError(dfe), _message(dfe._message), _file(dfe._file),
-      _line(dfe._line) {}
-
-    ///\e
-    explicit DataFormatError(const char *the_message)
-      : _message(the_message), _line(0) {}
-
-    ///\e
-    DataFormatError(const std::string &file_name, int line_num,
-                    const char *the_message)
-      : _message(the_message), _line(line_num) { file(file_name); }
-
-    ///\e
-    void line(int ln) { _line = ln; }
-    ///\e
-    void message(const std::string& msg) { _message.set(msg); }
-    ///\e
-    void file(const std::string &fl) { _file.set(fl); }
-
-    ///\e
-    int line() const { return _line; }
-    ///\e
-    const char* message() const {
-      if (_message.valid() && !_message.get().empty()) {
-        return _message.get().c_str();
-      } else {
-        return 0;
-      }
-    }
-
-    /// \brief Returns the filename.
-    ///
-    /// Returns \e null if the filename was not specified.
-    const char* file() const {
-      if (_file.valid() && !_file.get().empty()) {
-        return _file.get().c_str();
-      } else {
-        return 0;
-      }
-    }
-
-    ///\e
-    virtual const char* what() const throw() {
-      try {
-        std::ostringstream ostr;
-        ostr << "lemon:DataFormatError" << ": ";
-        if (message()) ostr << message();
-        if( file() || line() != 0 ) {
-          ostr << " (";
-          if( file() ) ostr << "in file '" << file() << "'";
-          if( file() && line() != 0 ) ostr << " ";
-          if( line() != 0 ) ostr << "at line " << line();
-          ostr << ")";
+      try {
+        _what.clear();
+        std::ostringstream oss;
+        oss << "lemon:IoError" << ": ";
+        oss << _message;
+        if (!_file.empty()) {
+          oss << " ('" << _file << "')";
         }
-        _message_holder.set(ostr.str());
+        _what = oss.str();
       }
       catch (...) {}
-      if( _message_holder.valid()) return _message_holder.get().c_str();
-      return "lemon:DataFormatError";
-    }
-
-    virtual ~DataFormatError() throw() {}
+      if (!_what.empty()) return _what.c_str();
+      else return "lemon:IoError";
+    }
+
   };
 
-  ///\e
-  class FileOpenError : public IoError {
+  /// \brief Format error
+  ///
+  /// This exception is thrown when an input file has wrong
+  /// format or a data representation is not legal.
+  class FormatError : public Exception {
   protected:
-    ExceptionMember<std::string> _file;
-
-    mutable ExceptionMember<std::string> _message_holder;
+    std::string _message;
+    std::string _file;
+    int _line;
+
+    mutable std::string _what;
   public:
 
-    FileOpenError(const FileOpenError &foe) :
-      IoError(foe), _file(foe._file) {}
-
-    ///\e
-    explicit FileOpenError(const std::string& fl)
-      : _file(fl) {}
-
-
-    ///\e
-    void file(const std::string &fl) { _file.set(fl); }
-
-    /// \brief Returns the filename.
-    ///
-    /// Returns \e null if the filename was not specified.
-    const char* file() const {
-      if (_file.valid() && !_file.get().empty()) {
-        return _file.get().c_str();
-      } else {
-        return 0;
-      }
-    }
-
-    ///\e
+    /// Copy constructor
+    FormatError(const FormatError &error) throw() : Exception() {
+      message(error._message);
+      file(error._file);
+      line(error._line);
+    }
+
+    /// Constructor
+    explicit FormatError(const char *message) throw() {
+      FormatError::message(message);
+      _line = 0;
+    }
+
+    /// Constructor
+    explicit FormatError(const std::string &message) throw() {
+      FormatError::message(message);
+      _line = 0;
+    }
+
+    /// Constructor
+    explicit FormatError(const char *message,
+                         const std::string &file, int line = 0) throw() {
+      FormatError::message(message);
+      FormatError::file(file);
+      FormatError::line(line);
+    }
+
+    /// Constructor
+    explicit FormatError(const std::string &message,
+                         const std::string &file, int line = 0) throw() {
+      FormatError::message(message);
+      FormatError::file(file);
+      FormatError::line(line);
+    }
+
+    /// Virtual destructor
+    virtual ~FormatError() throw() {}
+
+    /// Set the line number
+    void line(int line) throw() { _line = line; }
+
+    /// Set the error message
+    void message(const char *message) throw() {
+      try {
+        _message = message;
+      } catch (...) {}
+    }
+
+    /// Set the error message
+    void message(const std::string& message) throw() {
+      try {
+        _message = message;
+      } catch (...) {}
+    }
+
+    /// Set the file name
+    void file(const std::string &file) throw() {
+      try {
+        _file = file;
+      } catch (...) {}
+    }
+
+    /// \brief Returns the line number
+    ///
+    /// Returns the line number or zero if it was not specified.
+    int line() const throw() { return _line; }
+
+    /// Returns the error message
+    const std::string& message() const throw() {
+      return _message;
+    }
+
+    /// \brief Returns the filename
+    ///
+    /// Returns the filename or an empty string if it was not specified.
+    const std::string& file() const throw() {
+      return _file;
+    }
+
+    /// \brief Returns a short error message
+    ///
+    /// Returns a short error message which contains the message, the
+    /// file name and the line number.
     virtual const char* what() const throw() {
       try {
-        std::ostringstream ostr;
-        ostr << "lemon::FileOpenError" << ": ";
-        ostr << "Cannot open file - " << file();
-        _message_holder.set(ostr.str());
+        _what.clear();
+        std::ostringstream oss;
+        oss << "lemon:FormatError" << ": ";
+        oss << _message;
+        if (!_file.empty() || _line != 0) {
+          oss << " (";
+          if (!_file.empty()) oss << "in file '" << _file << "'";
+          if (!_file.empty() && _line != 0) oss << " ";
+          if (_line != 0) oss << "at line " << _line;
+          oss << ")";
+        }
+        _what = oss.str();
       }
       catch (...) {}
-      if( _message_holder.valid()) return _message_holder.get().c_str();
-      return "lemon::FileOpenError";
-    }
-    virtual ~FileOpenError() throw() {}
+      if (!_what.empty()) return _what.c_str();
+      else return "lemon:FormatError";
+    }
+
   };
 
-  class IoParameterError : public IoError {
-  protected:
-    ExceptionMember<std::string> _message;
-    ExceptionMember<std::string> _file;
-
-    mutable ExceptionMember<std::string> _message_holder;
-  public:
-
-    IoParameterError(const IoParameterError &ile) :
-      IoError(ile), _message(ile._message), _file(ile._file) {}
-
-    ///\e
-    explicit IoParameterError(const char *the_message)
-      : _message(the_message) {}
-
-    ///\e
-    IoParameterError(const char *file_name, const char *the_message)
-      : _message(the_message), _file(file_name) {}
-
-     ///\e
-    void message(const std::string& msg) { _message.set(msg); }
-    ///\e
-    void file(const std::string &fl) { _file.set(fl); }
-
-     ///\e
-    const char* message() const {
-      if (_message.valid()) {
-        return _message.get().c_str();
-      } else {
-        return 0;
-      }
-    }
-
-    /// \brief Returns the filename.
-    ///
-    /// Returns \c 0 if the filename was not specified.
-    const char* file() const {
-      if (_file.valid()) {
-        return _file.get().c_str();
-      } else {
-        return 0;
-      }
-    }
-
-    ///\e
-    virtual const char* what() const throw() {
-      try {
-        std::ostringstream ostr;
-        if (message()) ostr << message();
-        if (file()) ostr << "(when reading file '" << file() << "')";
-        _message_holder.set(ostr.str());
-      }
-      catch (...) {}
-      if( _message_holder.valid() ) return _message_holder.get().c_str();
-      return "lemon:IoParameterError";
-    }
-    virtual ~IoParameterError() throw() {}
-  };
-
   /// @}
 
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 280)
+++ lemon/graph_to_eps.h	(revision 291)
@@ -41,4 +41,5 @@
 #include<lemon/color.h>
 #include<lemon/bits/bezier.h>
+#include<lemon/error.h>
 
 
@@ -1167,6 +1168,11 @@
 graphToEps(G &g,const char *file_name)
 {
+  std::ostream* os = new std::ofstream(file_name);
+  if (!(*os)) {
+    delete os;
+    throw IoError("Cannot write file", file_name);
+  }
   return GraphToEps<DefaultGraphToEpsTraits<G> >
-    (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name),true));
+    (DefaultGraphToEpsTraits<G>(g,*os,true));
 }
 
@@ -1183,6 +1189,11 @@
 graphToEps(G &g,const std::string& file_name)
 {
+  std::ostream* os = new std::ofstream(file_name.c_str());
+  if (!(*os)) {
+    delete os;
+    throw IoError("Cannot write file", file_name);
+  }
   return GraphToEps<DefaultGraphToEpsTraits<G> >
-    (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name.c_str()),true));
+    (DefaultGraphToEpsTraits<G>(g,*os,true));
 }
 
Index: lemon/lgf_reader.h
===================================================================
--- lemon/lgf_reader.h	(revision 236)
+++ lemon/lgf_reader.h	(revision 291)
@@ -49,9 +49,11 @@
         std::istringstream is(str);
         Value value;
-        is >> value;
+        if (!(is >> value)) {
+          throw FormatError("Cannot read token");
+        }
 
         char c;
         if (is >> std::ws >> c) {
-          throw DataFormatError("Remaining characters in token");
+          throw FormatError("Remaining characters in token");
         }
         return value;
@@ -167,5 +169,5 @@
           std::ostringstream msg;
           msg << "Item not found: " << str;
-          throw DataFormatError(msg.str().c_str());
+          throw FormatError(msg.str());
         }
         return it->second;
@@ -185,10 +187,10 @@
       typename Graph::Arc operator()(const std::string& str) {
         if (str.empty() || (str[0] != '+' && str[0] != '-')) {
-          throw DataFormatError("Item must start with '+' or '-'");
+          throw FormatError("Item must start with '+' or '-'");
         }
         typename std::map<std::string, typename Graph::Edge>
           ::const_iterator it = _map.find(str.substr(1));
         if (it == _map.end()) {
-          throw DataFormatError("Item not found");
+          throw FormatError("Item not found");
         }
         return _graph.direct(it->second, str[0] == '+');
@@ -236,5 +238,5 @@
       char c;
       if (!is.get(c))
-        throw DataFormatError("Escape format error");
+        throw FormatError("Escape format error");
 
       switch (c) {
@@ -265,5 +267,5 @@
           int code;
           if (!is.get(c) || !isHex(c))
-            throw DataFormatError("Escape format error");
+            throw FormatError("Escape format error");
           else if (code = valueHex(c), !is.get(c) || !isHex(c)) is.putback(c);
           else code = code * 16 + valueHex(c);
@@ -274,5 +276,5 @@
           int code;
           if (!isOct(c))
-            throw DataFormatError("Escape format error");
+            throw FormatError("Escape format error");
           else if (code = valueOct(c), !is.get(c) || !isOct(c))
             is.putback(c);
@@ -301,5 +303,5 @@
         }
         if (!is)
-          throw DataFormatError("Quoted format error");
+          throw FormatError("Quoted format error");
       } else {
         is.putback(c);
@@ -461,4 +463,5 @@
     std::istream* _is;
     bool local_is;
+    std::string _filename;
 
     Digraph& _digraph;
@@ -510,7 +513,10 @@
     /// file.
     DigraphReader(const std::string& fn, Digraph& digraph)
-      : _is(new std::ifstream(fn.c_str())), local_is(true), _digraph(digraph),
+      : _is(new std::ifstream(fn.c_str())), local_is(true),
+        _filename(fn), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
-        _skip_nodes(false), _skip_arcs(false) {}
+        _skip_nodes(false), _skip_arcs(false) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Constructor
@@ -519,7 +525,10 @@
     /// file.
     DigraphReader(const char* fn, Digraph& digraph)
-      : _is(new std::ifstream(fn)), local_is(true), _digraph(digraph),
+      : _is(new std::ifstream(fn)), local_is(true),
+        _filename(fn), _digraph(digraph),
         _use_nodes(false), _use_arcs(false),
-        _skip_nodes(false), _skip_arcs(false) {}
+        _skip_nodes(false), _skip_arcs(false) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Destructor
@@ -846,5 +855,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_node_maps.empty())
-          throw DataFormatError("Cannot find map names");
+          throw FormatError("Cannot find map names");
         return;
       }
@@ -860,5 +869,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of node map: " << map;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           maps.insert(std::make_pair(map, index));
@@ -871,6 +880,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _node_maps[i].first;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Map not found: " << _node_maps[i].first;
+            throw FormatError(msg.str());
           }
           map_index[i] = jt->second;
@@ -896,9 +905,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
         }
         if (line >> std::ws >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Node n;
@@ -909,5 +918,5 @@
         } else {
           if (label_index == -1)
-            throw DataFormatError("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]);
@@ -915,5 +924,5 @@
             std::ostringstream msg;
             msg << "Node with label not found: " << tokens[label_index];
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           n = it->second;
@@ -939,5 +948,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_arc_maps.empty())
-          throw DataFormatError("Cannot find map names");
+          throw FormatError("Cannot find map names");
         return;
       }
@@ -953,5 +962,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of arc map: " << map;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           maps.insert(std::make_pair(map, index));
@@ -964,6 +973,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _arc_maps[i].first;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Map not found: " << _arc_maps[i].first;
+            throw FormatError(msg.str());
           }
           map_index[i] = jt->second;
@@ -988,8 +997,8 @@
 
         if (!_reader_bits::readToken(line, source_token))
-          throw DataFormatError("Source not found");
+          throw FormatError("Source not found");
 
         if (!_reader_bits::readToken(line, target_token))
-          throw DataFormatError("Target not found");
+          throw FormatError("Target not found");
 
         std::vector<std::string> tokens(map_num);
@@ -998,9 +1007,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
         }
         if (line >> std::ws >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Arc a;
@@ -1013,5 +1022,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << source_token;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           Node source = it->second;
@@ -1021,5 +1030,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << target_token;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           Node target = it->second;
@@ -1030,5 +1039,5 @@
         } else {
           if (label_index == -1)
-            throw DataFormatError("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]);
@@ -1036,5 +1045,5 @@
             std::ostringstream msg;
             msg << "Arc with label not found: " << tokens[label_index];
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           a = it->second;
@@ -1061,9 +1070,9 @@
         std::string attr, token;
         if (!_reader_bits::readToken(line, attr))
-          throw DataFormatError("Attribute name not found");
+          throw FormatError("Attribute name not found");
         if (!_reader_bits::readToken(line, token))
-          throw DataFormatError("Attribute value not found");
+          throw FormatError("Attribute value not found");
         if (line >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         {
@@ -1071,6 +1080,6 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute " << attr;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Multiple occurence of attribute: " << attr;
+            throw FormatError(msg.str());
           }
           read_attr.insert(attr);
@@ -1093,6 +1102,6 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found in file: " << it->first;
-          throw DataFormatError(msg.str().c_str());
+          msg << "Attribute not found: " << it->first;
+          throw FormatError(msg.str());
         }
       }
@@ -1109,7 +1118,4 @@
     void run() {
       LEMON_ASSERT(_is != 0, "This reader assigned to an other reader");
-      if (!*_is) {
-        throw DataFormatError("Cannot find file");
-      }
 
       bool nodes_done = _skip_nodes;
@@ -1130,5 +1136,5 @@
 
           if (line >> c)
-            throw DataFormatError("Extra character on the end of line");
+            throw FormatError("Extra character at the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -1152,6 +1158,7 @@
             skipSection();
           }
-        } catch (DataFormatError& error) {
+        } catch (FormatError& error) {
           error.line(line_num);
+          error.file(_filename);
           throw;
         }
@@ -1159,13 +1166,13 @@
 
       if (!nodes_done) {
-        throw DataFormatError("Section @nodes not found");
+        throw FormatError("Section @nodes not found");
       }
 
       if (!arcs_done) {
-        throw DataFormatError("Section @arcs not found");
+        throw FormatError("Section @arcs not found");
       }
 
       if (!attributes_done && !_attributes.empty()) {
-        throw DataFormatError("Section @attributes not found");
+        throw FormatError("Section @attributes not found");
       }
 
@@ -1245,4 +1252,5 @@
     std::istream* _is;
     bool local_is;
+    std::string _filename;
 
     Graph& _graph;
@@ -1294,7 +1302,10 @@
     /// file.
     GraphReader(const std::string& fn, Graph& graph)
-      : _is(new std::ifstream(fn.c_str())), local_is(true), _graph(graph),
+      : _is(new std::ifstream(fn.c_str())), local_is(true),
+        _filename(fn), _graph(graph),
         _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {}
+        _skip_nodes(false), _skip_edges(false) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Constructor
@@ -1303,7 +1314,10 @@
     /// file.
     GraphReader(const char* fn, Graph& graph)
-      : _is(new std::ifstream(fn)), local_is(true), _graph(graph),
+      : _is(new std::ifstream(fn)), local_is(true),
+        _filename(fn), _graph(graph),
         _use_nodes(false), _use_edges(false),
-        _skip_nodes(false), _skip_edges(false) {}
+        _skip_nodes(false), _skip_edges(false) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Destructor
@@ -1674,5 +1688,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_node_maps.empty())
-          throw DataFormatError("Cannot find map names");
+          throw FormatError("Cannot find map names");
         return;
       }
@@ -1688,5 +1702,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of node map: " << map;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           maps.insert(std::make_pair(map, index));
@@ -1699,6 +1713,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _node_maps[i].first;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Map not found: " << _node_maps[i].first;
+            throw FormatError(msg.str());
           }
           map_index[i] = jt->second;
@@ -1724,9 +1738,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
         }
         if (line >> std::ws >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Node n;
@@ -1737,5 +1751,5 @@
         } else {
           if (label_index == -1)
-            throw DataFormatError("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]);
@@ -1743,5 +1757,5 @@
             std::ostringstream msg;
             msg << "Node with label not found: " << tokens[label_index];
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           n = it->second;
@@ -1767,5 +1781,5 @@
         if (readSuccess() && line) line.putback(c);
         if (!_edge_maps.empty())
-          throw DataFormatError("Cannot find map names");
+          throw FormatError("Cannot find map names");
         return;
       }
@@ -1781,5 +1795,5 @@
             std::ostringstream msg;
             msg << "Multiple occurence of edge map: " << map;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           maps.insert(std::make_pair(map, index));
@@ -1792,6 +1806,6 @@
           if (jt == maps.end()) {
             std::ostringstream msg;
-            msg << "Map not found in file: " << _edge_maps[i].first;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Map not found: " << _edge_maps[i].first;
+            throw FormatError(msg.str());
           }
           map_index[i] = jt->second;
@@ -1816,8 +1830,8 @@
 
         if (!_reader_bits::readToken(line, source_token))
-          throw DataFormatError("Node u not found");
+          throw FormatError("Node u not found");
 
         if (!_reader_bits::readToken(line, target_token))
-          throw DataFormatError("Node v not found");
+          throw FormatError("Node v not found");
 
         std::vector<std::string> tokens(map_num);
@@ -1826,9 +1840,9 @@
             std::ostringstream msg;
             msg << "Column not found (" << i + 1 << ")";
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
         }
         if (line >> std::ws >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         Edge e;
@@ -1841,5 +1855,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << source_token;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           Node source = it->second;
@@ -1849,5 +1863,5 @@
             std::ostringstream msg;
             msg << "Item not found: " << target_token;
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           Node target = it->second;
@@ -1858,5 +1872,5 @@
         } else {
           if (label_index == -1)
-            throw DataFormatError("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]);
@@ -1864,5 +1878,5 @@
             std::ostringstream msg;
             msg << "Edge with label not found: " << tokens[label_index];
-            throw DataFormatError(msg.str().c_str());
+            throw FormatError(msg.str());
           }
           e = it->second;
@@ -1889,9 +1903,9 @@
         std::string attr, token;
         if (!_reader_bits::readToken(line, attr))
-          throw DataFormatError("Attribute name not found");
+          throw FormatError("Attribute name not found");
         if (!_reader_bits::readToken(line, token))
-          throw DataFormatError("Attribute value not found");
+          throw FormatError("Attribute value not found");
         if (line >> c)
-          throw DataFormatError("Extra character on the end of line");
+          throw FormatError("Extra character at the end of line");
 
         {
@@ -1899,6 +1913,6 @@
           if (it != read_attr.end()) {
             std::ostringstream msg;
-            msg << "Multiple occurence of attribute " << attr;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Multiple occurence of attribute: " << attr;
+            throw FormatError(msg.str());
           }
           read_attr.insert(attr);
@@ -1921,6 +1935,6 @@
         if (read_attr.find(it->first) == read_attr.end()) {
           std::ostringstream msg;
-          msg << "Attribute not found in file: " << it->first;
-          throw DataFormatError(msg.str().c_str());
+          msg << "Attribute not found: " << it->first;
+          throw FormatError(msg.str());
         }
       }
@@ -1956,5 +1970,5 @@
 
           if (line >> c)
-            throw DataFormatError("Extra character on the end of line");
+            throw FormatError("Extra character at the end of line");
 
           if (section == "nodes" && !nodes_done) {
@@ -1978,6 +1992,7 @@
             skipSection();
           }
-        } catch (DataFormatError& error) {
+        } catch (FormatError& error) {
           error.line(line_num);
+          error.file(_filename);
           throw;
         }
@@ -1985,13 +2000,13 @@
 
       if (!nodes_done) {
-        throw DataFormatError("Section @nodes not found");
+        throw FormatError("Section @nodes not found");
       }
 
       if (!edges_done) {
-        throw DataFormatError("Section @edges not found");
+        throw FormatError("Section @edges not found");
       }
 
       if (!attributes_done && !_attributes.empty()) {
-        throw DataFormatError("Section @attributes not found");
+        throw FormatError("Section @attributes not found");
       }
 
@@ -2055,4 +2070,5 @@
     std::istream* _is;
     bool local_is;
+    std::string _filename;
 
     typedef std::map<std::string, _reader_bits::Section*> Sections;
@@ -2075,5 +2091,8 @@
     /// Construct a section reader, which reads from the given file.
     SectionReader(const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true) {}
+      : _is(new std::ifstream(fn.c_str())), local_is(true),
+        _filename(fn) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Constructor
@@ -2081,5 +2100,8 @@
     /// Construct a section reader, which reads from the given file.
     SectionReader(const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true) {}
+      : _is(new std::ifstream(fn)), local_is(true),
+        _filename(fn) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Destructor
@@ -2237,10 +2259,10 @@
 
           if (line >> c)
-            throw DataFormatError("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;
-            throw DataFormatError(msg.str().c_str());
+            msg << "Multiple occurence of section: " << section;
+            throw FormatError(msg.str());
           }
           Sections::iterator it = _sections.find(section);
@@ -2251,6 +2273,7 @@
           readLine();
           skipSection();
-        } catch (DataFormatError& error) {
+        } catch (FormatError& error) {
           error.line(line_num);
+          error.file(_filename);
           throw;
         }
@@ -2261,5 +2284,5 @@
           std::ostringstream os;
           os << "Cannot find section: " << it->first;
-          throw DataFormatError(os.str().c_str());
+          throw FormatError(os.str());
         }
       }
@@ -2361,5 +2384,7 @@
     /// file.
     LgfContents(const std::string& fn)
-      : _is(new std::ifstream(fn.c_str())), local_is(true) {}
+      : _is(new std::ifstream(fn.c_str())), local_is(true) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Constructor
@@ -2368,5 +2393,7 @@
     /// file.
     LgfContents(const char* fn)
-      : _is(new std::ifstream(fn)), local_is(true) {}
+      : _is(new std::ifstream(fn)), local_is(true) {
+      if (!(*_is)) throw IoError("Cannot open file", fn);
+    }
 
     /// \brief Destructor
Index: lemon/lgf_writer.h
===================================================================
--- lemon/lgf_writer.h	(revision 248)
+++ lemon/lgf_writer.h	(revision 291)
@@ -56,5 +56,5 @@
     template <typename T>
     bool operator<(const T&, const T&) {
-      throw DataFormatError("Label map is not comparable");
+      throw FormatError("Label map is not comparable");
     }
 
@@ -204,5 +204,5 @@
           _map.find(str);
         if (it == _map.end()) {
-          throw DataFormatError("Item not found");
+          throw FormatError("Item not found");
         }
         return it->second;
@@ -224,5 +224,5 @@
           ::const_iterator it = _map.find(val);
         if (it == _map.end()) {
-          throw DataFormatError("Item not found");
+          throw FormatError("Item not found");
         }
         return (_graph.direction(val) ? '+' : '-') + it->second;
@@ -463,5 +463,7 @@
     DigraphWriter(const std::string& fn, const Digraph& digraph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph),
-        _skip_nodes(false), _skip_arcs(false) {}
+        _skip_nodes(false), _skip_arcs(false) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Constructor
@@ -471,5 +473,7 @@
     DigraphWriter(const char* fn, const Digraph& digraph)
       : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph),
-        _skip_nodes(false), _skip_arcs(false) {}
+        _skip_nodes(false), _skip_arcs(false) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Destructor
@@ -1019,5 +1023,7 @@
     GraphWriter(const std::string& fn, const Graph& graph)
       : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {}
+        _skip_nodes(false), _skip_edges(false) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Constructor
@@ -1027,5 +1033,7 @@
     GraphWriter(const char* fn, const Graph& graph)
       : _os(new std::ofstream(fn)), local_os(true), _graph(graph),
-        _skip_nodes(false), _skip_edges(false) {}
+        _skip_nodes(false), _skip_edges(false) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Destructor
@@ -1577,5 +1585,7 @@
     /// Construct a section writer, which writes into the given file.
     SectionWriter(const std::string& fn)
-      : _os(new std::ofstream(fn.c_str())), local_os(true) {}
+      : _os(new std::ofstream(fn.c_str())), local_os(true) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Constructor
@@ -1583,5 +1593,7 @@
     /// Construct a section writer, which writes into the given file.
     SectionWriter(const char* fn)
-      : _os(new std::ofstream(fn)), local_os(true) {}
+      : _os(new std::ofstream(fn)), local_os(true) {
+      if (!(*_os)) throw IoError("Cannot write file", fn);
+    }
 
     /// \brief Destructor
