Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Hi,

It looks to me like your patch will not keep subtypes (types derived
from) SQLException, but will instead "truncate" them to a
SQLException, and thus lose information.

Additionally, I would suggest, instead of silently suppressing all
subsequent errors, to chain all errors in one SQLException and then to
show them all in one dialog.

An SQLException has a "NextException" member, just stick the next
exception there. To avoid a Schlemiel the Painter / quadratic
algorithm, you can do something like (and factorise it in function,
I'd say), with the right Any-magic operators (<<=, >>=, etc) instead of
"=":

std::unique_ptr<SQLException> pTopException;
std::unique_ptr<SQLException> pBotException;

catch(SQLException &ex)
{
  if (!pTopException)
  {
    pTopException.reset(ex);
    pLastException.reset(ex);
  }
  else
  {
    assert(pLastException);
    while(pLastException->NextException is not empty)
    {
      pLastException.reset(pLastException->NextException);
      // This assumes pLastException will be a SQLException;
      // if it is not, I'm not sure what to do.
    }
    pLastException->NextException = ex;
  }
}

On Wed, May 16, 2018 at 09:11:40AM +0000, bugzilla-daemon@bugs.documentfoundation.org wrote:
https://bugs.documentfoundation.org/show_bug.cgi?id=117333

--- Comment #3 from Commit Notification <libreoffice-commits@lists.freedesktop.org> ---
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea19b96b6beb0ce2f25705339d1d6342dc38b283

tdf#117333, tdf#117325 dbahsql: exception handling

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.