buildMessage
[ Funktion ]
export function buildMessage(
error: TcHmi.IErrorDetails | undefined
): string;
Formats a recursive error detail object for output to the console. Please do not rely on the exact output format.
Parameter
Name |
Type |
Description |
---|---|---|
error |
Error detail object |
Return value
Type |
Description |
---|---|
Formatted output. If the input parameter is not an error object, an empty string is output. |
Available from version 1.10.1018.48 |
Sample - JavaScript
TcHmi.Symbol.readEx2(
'%l%nonExisting%/l%',
function(data){
TcHmi.Log.error('Did not work because of: ' + TcHmi.Log.buildMessage(data.details))})
/* Results in console message with something like that:
-------------------
[Error] Did not work because of: Code: 2010/0x7da, Message: E_SYMBOL_UNKNOWN
Reason: %l%nonExisting%/l%
Domain: TcHmi.System.Symbol
-------------------
*/
TcHmi.Symbol.readEx2(
'%f%%l%nonExisting%/l%.toString()%/f%',
function(data){
TcHmi.Log.error('Did not work because of: ' + TcHmi.Log.buildMessage(data.details))
}
)
/* Results in console message with something like that:
-------------------
[Error] Did not work because of: Code: 1/0x1, Message: ERROR
Reason: %f%%l%nonExisting%/l%.toString()%/f%, could not read value
Domain: TcHmi.System.Symbol
as result of: Code: 2010/0x7da, Message: E_SYMBOL_UNKNOWN
Reason: %l%nonExisting%/l%
Domain: TcHmi.System.Symbol
-------------------
*/