openui5
openui5 copied to clipboard
Documentation: sap.base.Log methods accept Error as second parameter
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?
I've created an internal incident 2270045087. The status of the issue will be updated here in GitHub.
Fixed with a6970f7f3239172ebcbf077b62f2b3453d25555f .
Thanks @codeworrior!