Skip to content

Store error context via cls and async_hooks #37

@CheerlessCloud

Description

@CheerlessCloud

I think with cls-hooked we can provide interface something like this:

EError.bindContext({ tracingId: 42 }, () => next());

// ------- in next middleware ----------

process.nextTick(() => {
  try {
    throw new EError('Something went wrong');
  } catch (err) {
    assert(err.tracingId === 42);
  }
});

Looks good, in my view 👀 Need PoC.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions