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] Patch to fix namecont.cxx
(In reply to comment #3) > Created attachment 59811 [details] [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] This includes the suggested changes for namecont.cxx
Created attachment 59855 [details] A patch for copytablewizard.cxx
(In reply to comment #5) > Created attachment 59853 [details] [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] > 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] 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
Abeer, if you continue doing these patches (please do!), just a minor nit: Please avoid exclamation marks in the exception messages. (Just my personal taste...)
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp) [NinjaEdit]
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
I would like to take a stab at this (I'm assuming this is an EasyHack). Can someone tell me what to do here, Which module to look at and which files to make the changes in ? I'm new. Thanks.
Can someone please assign this bug to me. Also whom should I contact here or on the IRC channel regarding this bug (#libreoffice-dev) .
(In reply to Sudarshan K from comment #17) > Can someone please assign this bug to me. Also whom should I contact here or > on the IRC channel regarding this bug (#libreoffice-dev) . just assign it yourself. I am here to help, source is in eg basic/uno (see comments) it is good if you have a little experience with uno. also please see https://wiki.documentfoundation.org/Development/GetInvolved
(In reply to jan iversen from comment #18) > (In reply to Sudarshan K from comment #17) > > Can someone please assign this bug to me. Also whom should I contact here or > > on the IRC channel regarding this bug (#libreoffice-dev) . > > just assign it yourself. I am here to help, > > > source is in eg basic/uno (see comments) > > it is good if you have a little experience with uno. > > > also please see > https://wiki.documentfoundation.org/Development/GetInvolved Hey jan, I have been looking into /basic/source/uno and here is what my understanding is - I see a lot of errors being thrown (just a simple RuntimeException(), I did a grep for RuntimeException()) without them being descriptive. So I need to make them throw the error with bit more details, the way Abeer Sethi has done. Am I correct in this ? Also, you said a little experience with uno would be required, could you direct me to the relevant docs ( This is my first attempt at contributing to LibOffice, so I have no experience with uno). Thanks.
Change to assigned You are correct in your assumption, find the RunTimeException and add description, that is basically the task. Go to our wiki.documentfoundation.org and search for UNO, but as you have already found the right way in the source you will not really need that. Happy hacking
jan iversen: This is the link for the patch - https://gerrit.libreoffice.org/#/c/29771/ I forgot to include this in the commit. I will remember that next time.
A polite ping, still working on this bug, or is it solved ?
Unassing due to lack of work
Hello. I'm a new contributor. I'd like to take a stab at this and make every plain RuntimeException in /basic/source/uno/* more descriptive.
jan iversen: I've submitted a patch https://gerrit.libreoffice.org/#/c/33227/
(In reply to Saurav S from comment #25) > jan iversen: I've submitted a patch https://gerrit.libreoffice.org/#/c/33227/ Welcome, I see Bergmann have already looked at your patch, when you correct it, please remember to use "git commit --amend" so you update the patch instead of making a new one. Apart from that, welcome, we have made a step-by-step guide for new people: https://wiki.documentfoundation.org/Development/GetInvolved Most importantly is to mail your license statement: https://wiki.documentfoundation.org/Development/Developers#Example_Code_Contributor_Statement have fun. jan I
Hello jan, I've submitted a second patch set taking into account Bergmann's comments, and I've sent my license statement to libreoffice@lists.freedesktop.org like the wiki suggested.
Oops, I'd left out a couple of changes from patch set 2. I've submitted one with all the updates. Sorry for the inconvenience!
Saurav Sachidanand committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2bcefa7aab176bf18b45e7038e91dd07ced6edf7 tdf#42982 Make UNO error reporting more descriptive It will be available in 5.4.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.
(In reply to Michael Stahl from comment #0) > subtypes of RuntimeException are always allowed, but there > are surprising exceptions (IIRC IllegalArgumentException is > one) that are not subtypes of RuntimeException. http://gimli.documentfoundation.org/docs/idl/ref/exceptioncom_1_1sun_1_1star_1_1uno_1_1RuntimeException.html says that IllegalArgumentException is RuntimeException.
(In reply to Aleksas Pantechovskis from comment #30) > http://gimli.documentfoundation.org/docs/idl/ref/ > exceptioncom_1_1sun_1_1star_1_1uno_1_1RuntimeException.html says that > IllegalArgumentException is RuntimeException. ...but only since <https://cgit.freedesktop.org/libreoffice/core/commit/?id=31170413ae3786bf44564e813d7291354e939a77> "API CHANGE: com.sun.star.lang.IllegalArgumentException"
Also looks like OSL_FORMAT was replaced by SAL_STREAM http://nabble.documentfoundation.org/Assertions-and-Logging-td3518719.html but git grep found only 2 usages of it. As far as I can see currently string concatenation via + operator is usually used ("cannot get service instance \"" + rServiceName + "\"!").
(In reply to Aleksas Pantechovskis from comment #32) > Also looks like OSL_FORMAT was replaced by SAL_STREAM > http://nabble.documentfoundation.org/Assertions-and-Logging-td3518719.html > but git grep found only 2 usages of it. > As far as I can see currently string concatenation via + operator is usually > used ("cannot get service instance \"" + rServiceName + "\"!"). Yeah, comment 0 is a bit dated by now. :) SAL_STREAM should be rarely necessary, if at all (the two uses in sfx2/source/control/bindings.cxx could arguably be rewritten using string concatenation with + instead), and should never be necessary when generating useful exception messages in the context of this issue. Always use string concatenation for that (use OUString::number to put numbers into the message).
Alex P committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=7e8806cd728bf906e1a8f1d649bef7337f297b1c tdf#42982 improve error reporting in sc unoobj It will be available in 5.4.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.
Michael or Stephan, can you briefly verify that the two associated patches merged already completely resolve this issue? https://gerrit.libreoffice.org/34762 https://gerrit.libreoffice.org/33227
i can briefly confirm that the patches from comment #35 have resolved at most 3% of the issue. git grep "throw .*RuntimeException *( *)" | wc -l 1582
Samuel Mehrbrodt committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4b56d76e83fe062e39f5c00fa405f2a14a13b7ca tdf#42982 Improve exceptions in text document api It will be available in 6.0.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.
Izabela Bakollari committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0f190f50368816964b2a1b7bb58000ac1792d640 tdf#42982: added description on RuntimeException It will be available in 6.2.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.
nienzu committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d8fe52d759ba033bd661893f12d17576d24276db tdf#42982 add detail exception reason for UnoControls It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Burak Bala committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7aaa3109edfc2e1fadc533d4d276ee7c14b80dea tdf#42982 Make UNO error reporting more descriptive It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Faruk Demirbaş committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eee035a7c0d8923134d0e3a8520d13706ce9bf9f tdf#42982: Improve UNO API error reporting It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mesut Çifci committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4f1e3dd278d6c65b8b1b198562d1649bad79622b tdf#42982: improve UNO API error reportings It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
AlanTang committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/da7617641b5d955610ae25bda65fa10c4ca1b7c3 tdf#42982 added description on RuntimeException for unotools It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ian Barkley-Yeung committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b762eaba776abde3173a39df3133d1d1b40ccd44 tdf#42982: Improve UNO API error reporting It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ian Barkley-Yeung committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/27306e0eeee8a22e554f6f5bebccca4f778ae731 tdf#42982: Improve UNO API error reporting It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Please review the changes made by me: https://gerrit.libreoffice.org/c/core/+/108356/2
Please review the recent changes made:https://gerrit.libreoffice.org/c/core/+/108356/2
homeboy445 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7bd5c31472804624d740d8c831d3b043f2d3a0be tdf#42982 Improved UNO API error reporting It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bayram Çiçek committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/32676270d194b68d7dd811511feb0903876b5c06 tdf#42982: Improve UNO API error reporting It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tarun Sharma committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3ff95c8df6be9aa01aef5c663ee2ffa9881193d4 tdf#42982: Improve UNO API error reporting It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I am new to the LibreOffice community. Can I start working on this bug?
(In reply to adityapratapsingh51 from comment #51) > I am new to the LibreOffice community. Can I start working on this bug? You sure can
Please review the recent changes made by me https://gerrit.libreoffice.org/c/core/+/110261
I am thinking of passing a message in ElementExistException(). Should I pass the message(string) only or there is also I need to pass two arguments?
(In reply to Vipul from comment #54) > I am thinking of passing a message in NoSuchElementException(). Should I pass > the message(string) only or there is also I need to pass two arguments?
(In reply to adityapratapsingh51 from comment #53) > Please review the recent changes made by me > https://gerrit.libreoffice.org/c/core/+/110261 Someone please review this patch
Aditya Pratap Singh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8ad6257d456c595a47669846fc3ef5337653bd03 tdf#42982 Add descriptions to some runtime exceptions It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
vipbuoy committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1775cd844bc5b45e1f40148051ad9cc2635413e0 tdf#42982 updated RunTimeException with 2nd argument(pointer) It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
ViKrAm-Bais committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/394ad7fa73ec70e576a4b0bdfaa7cc2986e1bf46 tdf#42982: improve UNO API error reporting It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I checked all the runtime exception are descriptive now , then why this issue is still open?
(In reply to Padia Rashesh from comment #61) > I checked all the runtime exception are descriptive now , then why this > issue is still open? According to git grep "throw .*RuntimeException *( *)" | wc -l there are still 1465 places to change, so I wonder how you checked?
Olivier Hallot committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/75fca5341ec1e4d0a0113fce26df9992d7352591 tdf#42982 RuntimeException msg for SwXFrame::setName() It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
4k5h1t committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5f4a84ce5b775eb017bd784db95857684b7e90ed tdf#42982: improve UNO API error reporting It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verne-Lai committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/dad5b69b229047e0bba921f185dddd6ce26183a5 [tdf#42982]Improve runtimeException's Message It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
4k5h1t committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0776e75fbc09201052e27a33cbc9e8f117b43596 tdf#42982: improve UNO API error reporting It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Deep17 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1fb1f0be10b5d6ce3be5bb364b4c9a8eb0d31b54 tdf#42982: improve UNO API error reporting It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Siddhant Chaudhary committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/370077502210f4d41a1d2014c3e3f99536217ce7 tdf#42982 Improved UNO API error reporting. It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Re-evaluating the EasyHack in 2022 This issue is still relevant, as there are many places in the code that should be changes. $ git grep "throw .*RuntimeException *( *)" | wc -l 1487
Mahdi Tizabi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/cab4fd84ff9f59027d4de5a0bb96d50b7b07df13 tdf#42982 Improved UNO API error reporting It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
PoonamShokeen committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d29958304b3ff87115ed5af16b482327ea05ce14 tdf#42982 improve UNO API error reporting It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Calvince Otieno committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/71aaa2eaa25f1a6bc958c5dcffa79b478ddfa664 tdf#42982 Make UNO error reporting more descriptive It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jani Saranpää committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6dfa9c7c0db91a71f3787226636864161d5367ca tdf#42982 Improve UNO API error reporting It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ankit_Jaipuriar committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a97ceaf14e294373b864c61c930f8723e13747c7 tdf#42982 Improved UNO API error reporting It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
khushishikhu committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/baf677e2f1130205df6e4a5cf0a94f4d9dc228a5 tdf#42982: Improve UNO API error reporting It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Re-evaluating the EasyHack in 2023 This issue is still relevant. There are still many instances of the UNO API error reports that need improvement: Number of instances to be changed: $ git grep "throw .*RuntimeException *( *)" *.cxx| wc -l 1418 Number of C++ files to be changed: $ git grep -l "throw .*RuntimeException *( *)" *.cxx|wc -l 316 One can refer to this blog post for a detailed description of the task: UNO API error reporting improvement – EasyHack https://dev.blog.documentfoundation.org/2023/10/26/uno-api-error-reporting-improvement-easyhack/
I am starting to work on this bug. This is my first easy hack attempt.
Can please somebody give me steps on how to solve a bug here, I tried reading above comments but didn't understand anything.
(In reply to Vivek Kumar from comment #78) > Can please somebody give me steps on how to solve a bug here, I tried > reading above comments but didn't understand anything. There is no bug to solve here. This is about making the API development experience better. In addition to reading comments, also read commits. If you want to receive our standard mentoring, email me.
seturaj committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b508e4f0813b62c3e5d10a2fbacec1fb8839ece4 tdf#42982: Improve UNO error reporting. Make exceptions more descriptive It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
AhmedHamed committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/487ce28057656e752dc9bb7eddea5befb446ad0a tdf#42982 Improve UNO API error reporting It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
varshneydevansh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/cc695e180b39ffe21f0ae12cfeefb89a50a50b64 tdf#42982: Improve UNO API error reporting It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
RMZeroFour committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/599b113b732190749385293a9fbc8ffc3e618556 tdf#42982 Add error messages to thrown exceptions It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mohit Marathe committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e211607dffe2986601359dcb1ef757fda3805fb3 tdf#42982: Improve UNO API error reporting It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I am going to start working on this easy hack
Multi-hack, so never assigned.
HakimOttey committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/7153b25d4da845bfb309c75df48f9ea00ec70c47 tdf#42982 Use IllegalTypeException Error with message It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Commit Notification from comment #87) > tdf#42982 Use IllegalTypeException Error with message Looking at commit 7153b25d4da845bfb309c75df48f9ea00ec70c47, I have a feeling that only by accident, it didn't break the API guarantees. So let me clarify an important consideration that any easyhacker here must keep in mind. I do it using the said commit as an example. The commit changed EnumerableMap::impl_initValues_throw. The function used to throw RuntimeException [1], and now it throws IllegalTypeException [2]. The function is used in EnumerableMap::initialize, which (as it is obvious from the EnumerableMap class definition) is an implementation of the XInitialization method [3]. It is important to realize, that the method is part of the published API, including its exceptions guarantee. So this change must make sure to check, that it doesn't break the API. In this case, the documentation specifies that the method throws Exception, which is luckily the ancestor of both RuntimeException and IllegalTypeException (so it is not an API break). But please make sure, that every commit that changes a thrown exception type, is careful to explain this in the commit message, and document there, which APIs the change affects, and that the change doesn't break those APIs' guarantees. [1] https://api.libreoffice.org/docs/idl/ref/exceptioncom_1_1sun_1_1star_1_1uno_1_1RuntimeException.html [2] https://api.libreoffice.org/docs/idl/ref/exceptioncom_1_1sun_1_1star_1_1beans_1_1IllegalTypeException.html [3] https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1lang_1_1XInitialization.html#a4c324e2c089ac21cc486cdf1e611e03e
Beeram_12 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/458f5a7e8c2cd2e38eb744f6046f27874f0a0fa0 tdf#42982 Improve UNO API error reporting It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
HakimOttey committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6aa87b23c445b42690a2461817b7ad24f6c31ec9 Related: tdf#42982 replace IllegalTypeException with RuntimeException It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ashok committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/dbccdea9744c5400a5dad908bce5d2973ac60f3c tdf#42982 Improve Error Messages with RuntimeException in UNO API It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Oromidayo Owolabi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ca1f1962ae163345ecaedc288244448589ae2a0e tdf#42982 Improve UNO API error reporting It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.