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".
Can you tell me from my git-diff whether I'm on the right track? http://pastebin.com/raw.php?i=XAR4s81e
Re comment 1: 1 Lines are cut from the output in <http://pastebin.com/raw.php?i=XAR4s81e>. (And better attach a patch to this issue than going via pastebin, anyway.) 2 For simple string messages like throw RuntimeException(OSL_FORMAT("XListener is not equal to 1")); there is no need to go via OSL_FORMAT. The standard idiom to create an rtl::OUString instance from an (ASCII) string literal for now is rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XListener is not equal to 1")) 3 RuntimeException constructors either take no arguments or two arguments (Message, a string; and Context, a com::sun::star::uno::XInterface reference to the relevant UNO object or a null reference). So, in basic/source/uno/namecont.cxx you would need a second argument static_cast< cppu::OWeakObject * >(this) (where the cast is necessary as this derives from XInterface multiple times), and in the later files you would need to move your new, third argument to be the first one instead, replacing the empty "rtl::OUString()"
Created attachment 59811 [details] [review] Patch to fix namecont.cxx
(In reply to comment #3) > Created attachment 59811 [details] [review] [review] > Patch to fix namecont.cxx See <http://lists.freedesktop.org/archives/libreoffice/2012-April/029894.html> for a comment about that patch. (In general, it is better to present a patch for review in one place only, either in a bug or on the mailing list.)
Created attachment 59853 [details] [review] This includes the suggested changes for namecont.cxx
Created attachment 59855 [details] [review] A patch for copytablewizard.cxx
(In reply to comment #5) > Created attachment 59853 [details] [review] [review] > This includes the suggested changes for namecont.cxx pushed as <http://cgit.freedesktop.org/libreoffice/core/commit/?id=c9afb3f5a7f713d34f70b680c5d4ab3db4044d1c>
(In reply to comment #6) > Created attachment 59855 [details] [review] [review] > A patch for copytablewizard.cxx pushed as <http://cgit.freedesktop.org/libreoffice/core/commit/?id=67d022ac0ce5e67565e0589f4cd9eb05a8fd5a3c>
Deleted "Easyhack" from summary.
Comment on attachment 59855 [details] [review] A patch for copytablewizard.cxx i'll mark this as "obsolete" since it was integrated, so that it doesn't show up in bugzilla searches
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Restricted my LibreOffice hacking area
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.