I have a class hierarchy, and each class in it has an exception class, derived in a parallel hierarchy, thus...
class Base
{
};
class Derived : public Base
{
};
To me, it seems more reasonable to have an exception class for each exception reason. When handling an exception, it is usually not interesting to know which class threw the exception, but for what reason the exception was thrown.
If you want to keep your design: C++ does not allow you to extend an existing enum, but you can create a new enum that starts where a previous one left off:
class BaseException : public std::exception
{
enum {THIS_REASON, THAT_REASON, END_OF_BASE_REASONS };
};
class DerivedException : public BaseException
{
enum {OTHER_REASON = BaseException::END_OF_BASE_REASONS };
};