Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

can something useful be reported about unhandled rejections? #75

Description

@sam-github

https://nodejs.org/api/process.html#process_event_unhandledrejection and the mention of a "PromiseHook C++ API" (nodejs/node#11752) sparked my curiousity, its an interesting thing to know about an applications state.

Activity

  1. Fishrock123 commented on Mar 13, 2017

    @Fishrock123
    Contributor

    What kind of thing are you hoping for?

  2. Fishrock123 commented on Mar 13, 2017

    @Fishrock123
    Contributor

    like "these rejections happened before the crash" or something?

  3. Fishrock123 commented on Mar 20, 2017

    @Fishrock123
    Contributor
  4. sam-github commented on Mar 20, 2017

    @sam-github
    ContributorAuthor

    I was thinking specifically of the list of all promises that are currently rejected but do not have error handlers attached. Basically what the unhandledRejection event emits. However, it emits it after one "turn of the event loop" (an ill defined concept). Those promises may get an error handler attached sometime later... or may not, and their presence at time of node report may be interesting, if we know something about them that is reportable.

  5. Fishrock123 commented on Mar 21, 2017

    @Fishrock123
    Contributor

    Hmmm, so I think this means hooking into v8::Isolate::SetPromiseRejectCallback() but that also then means we hijack core's handler...

    So we might either have to add a c++ node api for that, or polyfill the node behavior from here...

    Also, on shutdown we'd need to synchronously extract the "reason" data. Not too terribly difficult with the debug api, but very hacky and, well, the V8 people are not a fan of people using it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions