Skip to content

Store error context via cls and async_hooks #37

@CheerlessCloud

Description

@CheerlessCloud
Owner

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @CheerlessCloud

        Issue actions

          Store error context via cls and async_hooks · Issue #37 · CheerlessCloud/eerror-js