Skip to content

Commit

Permalink
Say what type T is on decoration-already-exists error, #9891
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonald committed Jul 30, 2014
1 parent 5ccee33 commit da232c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions autowiring/AutoPacket.h
Expand Up @@ -241,8 +241,12 @@ class AutoPacket:
{
std::lock_guard<std::mutex> lk(m_lock);
auto& entry = m_decorations[typeid(type)];
if(entry.satisfied)
throw std::runtime_error("Cannot decorate this packet with type T, the requested decoration already exists");
if (entry.satisfied) {
std::stringstream ss;
ss << "Cannot decorate this packet with type " << typeid(type).name()
<< ", the requested decoration already exists";
throw std::runtime_error(ss.str());
}
if(entry.isCheckedOut)
throw std::runtime_error("Cannot check out this decoration, it's already checked out elsewhere");
entry.isCheckedOut = true;
Expand Down

0 comments on commit da232c4

Please sign in to comment.