Skip to content
Snippets Groups Projects
Commit 99d04857 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Add message in exception when a signal type is already registered.

    * src/signal/signal-caster.cpp.
parent 0e6ee86d
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,13 @@ SignalCaster::~SignalCaster() { ...@@ -29,8 +29,13 @@ SignalCaster::~SignalCaster() {
void SignalCaster::registerCast(const type_info& type, SignalCaster::displayer_type displayer, void SignalCaster::registerCast(const type_info& type, SignalCaster::displayer_type displayer,
SignalCaster::caster_type caster, SignalCaster::tracer_type tracer) { SignalCaster::caster_type caster, SignalCaster::tracer_type tracer) {
if ( existsCast(type) ) if ( existsCast(type) ) {
throw ExceptionSignal(ExceptionSignal::GENERIC); //TODO: throw "cast already registered for type" exception std::string typeName(type.name());
std::ostringstream os;
os << "cast already registered for type " << typeName << ".";
throw ExceptionSignal(ExceptionSignal::GENERIC,
os.str()); //TODO: throw "cast already registered for type" exception
}
functions_[type.name()] = cast_functions_type(displayer,caster, tracer); functions_[type.name()] = cast_functions_type(displayer,caster, tracer);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment