I don't think runtime_error is the right base class, have a look at what the other subclasses of runtime_error are. This is different than those.