https://bugs.freedesktop.org/show_bug.cgi?id=42982

             Bug #: 42982
           Summary: [EasyHack] improve UNO API error reporting
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO Master
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: medium
         Component: Libreoffice
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


There are many implementations of UNO APIs in LibreOffice,
and a lot of them have only very primitive error reporting.

In many cases the only form of error reporting used is
"throw RuntimeException;", which is completely unhelpful
to API users such as extension developers.

Such exceptions should be improved:

1. most importantly, an error message should be included in
   the exception so the API user may get some idea what
   is going wrong.
   for this, the newly introduced printf-style OSL_FORMAT
   macro may be useful.

2. in some cases a more specific exception than RuntimeException
   can be thrown.
   but beware that only the exceptions that are listed in the
   exception specification of the UNO API method may be thrown;
   subtypes of RuntimeException are always allowed, but there
   are surprising exceptions (IIRC IllegalArgumentException is
   one) that are not subtypes of RuntimeException.

the offending exceptions can easily be found with "git grep".

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to