Open
Description
It would be great if error tracing can be done using following API.
try {
}
catch (err) {
TraceError.sysoutError(err);
}
no need to specify the "EXCEPTION" keyword, the log should be red in the tracing console automatically.
Currently we have to:
TraceError.sysout("Grip.getProps; EXCEPTION " + err, err);
@fflorent: since you are working on issue #1, perhaps you could do this one too?
Honza
Edit: Good first bug. Basically, the idea is to test if:
- The method was called using
TraceError.sysout()
- the first argument is an exception.
If it is the case (let err
be the exception argument):
- Get the name of the calling method using
err.stack
(or maybeComponents.stack
if it doesn't provide the name) - Print the equivalent of:
TraceError.sysout("<name of the calling method>; EXCEPTION " + err, err);
TraceError
is initialised in lib/core/trace.js
Florent