for clarity, could this method body look something more like:

stringstream ss;
if/else block (for each test): ss << correctly_cast_item;
return ss.str();

the error notification can reside in a final "else" block.