Replaced ThrowError with BOOST_THROW_EXCEPTION.