ConnStateData::callException(const std::exception &ex)
{
    Server::callException(ex); // logs ex and stops the job

    ErrorDetail::Pointer errorDetail;
    if (const auto tex = dynamic_cast<const TextException*>(&ex))
        errorDetail = new ExceptionErrorDetail(tex->id());
    else
        errorDetail = new ExceptionErrorDetail(Here().id());
    updateError(ERR_GATEWAY_FAILURE, errorDetail);
}
ConnStateData::callException(const std::exception &ex)
{
    Server::callException(ex);  

    ErrorDetail::Pointer errorDetail;
    if (const auto tex = dynamic_cast<const TextException*>(&ex))
        errorDetail = new ExceptionErrorDetail(tex->id());
    else
        errorDetail = new ExceptionErrorDetail(Here().id());
    updateError(ERR_GATEWAY_FAILURE, errorDetail);
}