openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Documentation: sap.base.Log methods accept Error as second parameter

Open fbunsmann opened this issue 3 years ago • 1 comments

OpenUI5 version: 1.99.0

I'm using the ui5 typescript types for developing ui5 applications. That already works quite well, however I noticed that the different log methods fatal/error/warning/info/debug/trace in sap/base/Log currently have the following parameters documented

https://github.com/SAP/openui5/blob/e7a495d975fcd8e1105e3bfa79a60a6f157b18f4/src/sap.ui.core/src/sap/base/Log.js#L219-L222

while internally, the log() method also allows to give an Error as second parameter for sDetails, which is very useful to log error objects to the console.

https://github.com/SAP/openui5/blob/e7a495d975fcd8e1105e3bfa79a60a6f157b18f4/src/sap.ui.core/src/sap/base/Log.js#L383

As far as I know the typescript types are generated from the jsdocs. Could you adjust the jsdocs for the different log methods which are part of the public API so that Error objects are also allowed?

fbunsmann avatar Mar 25 '22 13:03 fbunsmann

I've created an internal incident 2270045087. The status of the issue will be updated here in GitHub.

tsanislavgatev avatar Mar 28 '22 11:03 tsanislavgatev

Fixed with a6970f7f3239172ebcbf077b62f2b3453d25555f .

codeworrior avatar Nov 14 '22 10:11 codeworrior

Thanks @codeworrior!

fbunsmann avatar Nov 14 '22 12:11 fbunsmann