// Let's Use our X-Ray Vision to Look at the Innards of our Hero


template<class DataObj, class ParamObj = DefaultParamObj<DataObj> > class OurHeroicHandler
{
private:
	// ... some state data, but assume handler is default constructible
public:

	dtl_ios_base::MeansOfRecovery
		operator()(RootException &ex, dtl_ios_base &base,
		   DataObj &data, ParamObj &params)
	{
		// example of what you might do in a handler
		if (bad())
		{
			LogErrorToFile(ex);
			return dtl_ios_base::THROW_EXCEPTION;
		}
		else if (fail())
		{
			// tries to make the DataObj valid and then reapplies previous operation
			// to base on the good object ... may still fail
			bool failed = WorkMagicOnDataObjAndTryAgain(...);

			if (failed)
			{
				LogErrorToFile(ex);
				return dtl_ios_base::THROW_EXCEPTION;
			}
			else
				return dtl_ios_base::SUPPRESS_ERROR; // success ... our superhero
								     // has saved the day!
		}
	}
};