[Libreoffice] uno discoverability

Michael Stahl mstahl at redhat.com
Tue Nov 15 11:34:46 PST 2011


On 15/11/11 19:57, Kevin Hunter wrote:
> Is it similarly as convoluted and difficult to have an explanation with,
> say, RuntimeExceptions? For instance, with a document with only one
> sheet, one should not be able to remove the last sheet, right?
>
>  >>> doc.Sheets.removeByName('Sheet1')
> ---------------------------------------------------------------------------
> com.sun.star.uno.RuntimeException Traceback (most recent call last)
>
> /home/kevin/ram/temoa/branches/tmpp/<ipython console> in <module>()
>
> com.sun.star.uno.RuntimeException:
>
>  >>>
>
> Which is correct of course, but not terribly elucidating (note the empty
> trailing colon). Would this be a simple case of putting an RTL...string
> in removeByName in docuno.cxx?

in a lot of UNO API implementations the only form of error reporting 
used is "throw RuntimeException;", which leaves (as you correctly note) 
a lot to be desired in terms of usability for the hapless API user.

this definitely ought to be an easy hack, as putting a more helpful 
error message in there can really be done by anyone: patches welcome.



More information about the LibreOffice mailing list