Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

flush method or event... Known that an error has been sent #167

Closed

Description

@jonasfj

It would be nice to a reliable way to know if an error has been sent.
As you can't call process.exit(1) before having sent the error.

Activity

  1. jonasfj commented on Jun 8, 2016

    @jonasfj
    Author

    @mattrobenolt,
    This doesn't work if I'm sending multiple errors concurrently.
    I have no way of know what message an error event was related to..
    I probably won't be sending multiple errors in parallel, but this is just getting sketchy, and I don't like that :)

    Ideal would be for captureMessage to return a promise.

    But a mere flush() method, so that we could do:
    sentry.flush().catch(err => console.log(...)).then(() => process.exit(1));
    would be nice...

    ie. so flush() is done when there is no pending/outstanding messages..

  2. mattrobenolt commented on Jun 8, 2016

    @mattrobenolt
    Contributor

    In Go, we have a different method entirely which is CaptureAndWait() which then returns after the payload has been sent.

    We could do similar in node here, where instead of actually waiting, it's just a promise or callback. I'm not too up to date on the state of promises to say what'd be involved in supporting that, but a callback would probably be more trivial in the current state of codebase.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions