Rethrowing hides the real source of the exception.
// store a copy of the exception that you can find out details about the error later
constructorException = e.clone();
}
- catch (...)
- {
- throw;
- }
}
}
msg << "archive_exception while serializing on client-side, code " << e.code << " (" << e.what() << ")";
throw t2n_serialization_error(msg.str());
}
- catch(...)
- { throw; }
std::ostream* ostr;
if ((ostr=c->get_logstream(fulldebug))!=NULL)
msg << "archive_exception while deserializing on client-side, code " << e.code << " (" << e.what() << ")";
throw t2n_serialization_error(msg.str());
}
- catch(...)
- { throw; }
if ((ostr=c->get_logstream(fulldebug))!=NULL)
{
"code " << e.code << " (" << e.what() << ")";
res.set_exception(new t2n_serialization_error(msg.str()));
}
- catch(...)
- { throw; }
if (!res.has_exception())
{
}
catch (t2n_exception &e)
{ res.set_exception(e.clone()); }
- catch (...)
- { throw; }
}
else
{
res.set_exception(new t2n_serialization_error(msg.str()));
oa << res;
}
- catch(...)
- { throw; }
std::ostream* ostr;
if ((ostr=s.get_logstream(fulldebug))!=NULL)
// shut down a connection with transfer errors (usually write errors)
conn->close();
}
- catch(...)
- { throw; }
}
}
}
}
catch (t2n_transfer_error &e)
{ i->second->close(); }
- catch(...)
- { throw; }
}
return data_found;
// otherwise ignore the exception and reconnect in the next iteration
}
- catch(...)
- {
- throw;
- }
tries++;
}
{
// ignore
}
- catch(...)
- {
- throw;
- }
}
return false;
}
catch(t2n_command_error &e)
{ ret=e.what(); }
- catch(...)
- { throw; }
string expected_what="illegal command of type ";
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
bool test_fine=false;
if (errormsg == "write() returned Bad file descriptor"
}
catch(t2n_serialization_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("archive_exception while serializing on client-side, code 2 (unregistered class)"),errormsg);
}
}
catch(t2n_runtime_error &e)
{ ret=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("throw me around"),ret);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("timeout exceeded"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg);
}
}
catch(t2n_transfer_error &e)
{ errormsg=e.what(); }
- catch(...)
- { throw; }
BOOST_CHECK_EQUAL(string("write() returned Broken pipe"),errormsg);
}