15 #ifndef ECL_EXCEPTIONS_DATA_EXCEPTION_HPP_ 
   16 #define ECL_EXCEPTIONS_DATA_EXCEPTION_HPP_ 
   22 #include <ecl/config/ecl.hpp> 
   23 #ifndef ECL_DISABLE_EXCEPTIONS 
   57 template <
typename Data>
 
   58 class DataException : 
public Exception
 
   63         DataException(
const char* loc, 
const DataException<Data> &e );
 
   67         const char* 
what() 
const throw();
 
   70         const Data& data()
 const { 
return error_data; } 
 
   87 template <
typename Data>
 
  100 template <
typename Data>
 
  113 template <
typename Data>
 
  116     error_type(e.flag()),
 
  117     error_data(e.data()),
 
  120     location = std::string(loc) + 
"\n         : " + e.location;
 
  127 template <
typename Data>
 
  130     std::string what_msg;
 
  132     std::ostringstream stream;
 
  133     stream << 
"\n" << 
"Location : " << this->location << 
"\n";
 
  134     stream << 
"Flag     : " << Error(error_type).what() << 
"\n";
 
  135     if ( message.size() > 0 ) {
 
  136         stream << 
"Detail   : " << message << 
"\n";
 
  138     stream << 
"Data     : " << error_data << 
"\n";
 
  139     what_msg = stream.str();
 
  140     return what_msg.c_str();