#ifndef EXCEPT_H_INC
#define EXCEPT_H_INC

#ifndef NO_RTTI
    #include <typeinfo>
#endif

#include <string>

class DSException
{
  public:
    DSException( const std::string & msg = "" ) : message( msg )
      { }
    virtual ~DSException( )
      { }
    virtual std::string what( ) const
      { return message; }
    virtual std::string toString( ) const
      { return std::string( "Exception " ) +
#ifndef NO_RTTI
               typeid( *this ).name( ) +
#endif
               ": " +
               what( ); }

  private:
    std::string message;
};

class BadArgumentException : public DSException
{
  public:
      BadArgumentException( const std::string & msg = "" )
         : DSException( msg ) { }
};

#endif
