Tue 04 Nov 2008 09:44:49 PM UTC, comment #1:
I would say that tick should only throw exception
that are included in its signature:
RTI::RTIambassador::tick()
throw (SpecifiedSaveLabelDoesNotExist,
ConcurrentAccessAttempted,
RTIinternalError)
thus:
1) When RTIA throw an exception it should be wrapped
into RTIinternalError which may be thrown
2) should throw RTIinternalError if communication with RTIA fails
Agreed.
throw RTIinternalError("RTIA communication FAILED")
3) should throw RTIinternalError if the federate ambassador's callback throws any exception
Agreed too, the federate exception should be caught
and properly wrapped into RTIinternalError.
4) tick() should not throw anything else Yes but
ConcurrentAccessAttempted
SpecifiedSaveLabelDoesNotExist
should be candidate for removal then.
Note that the 1516 spec says concerning evoke
that it could throw:
RTIinternalError
FederateNotExecutionMember
thus _tick_kernel should stick with this.
We could wrapped any exception inside RTIinternalError
by doing something like:
catch (WhateverRTIException& e) {
std::stringstream exceptMsg;
exceptMsg << "::" << e._name << "[" << e._reason << "]";
throw RTIinternalError(exceptMsg.c_str());
}
or more simply processException should NOT rethrow
but build the std::string.
Then we could
if (vers_Fed.getExceptionType() != e_NO_EXCEPTION)
throw RTIinternalError(privateRefs->processException(&vers_Fed));
|