Skip to content

Simplify error tracing API #17

Open
@janodvarko

Description

@janodvarko

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:

  1. The method was called using TraceError.sysout()
  2. the first argument is an exception.

If it is the case (let err be the exception argument):

  1. Get the name of the calling method using err.stack (or maybe Components.stack if it doesn't provide the name)
  2. Print the equivalent of: TraceError.sysout("<name of the calling method>; EXCEPTION " + err, err);

TraceError is initialised in lib/core/trace.js

Florent

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions