-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#327 notifyAsync #684
#327 notifyAsync #684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Love the test coverage. I do wonder, though—isn't there a global version of afterNotify
? From the docs:
Honeybadger.afterNotify((err, notice) => {
if (err) { return console.log(`Honeybadger notification failed: ${err}`); }
console.log(`Honeybadger notice: https://app.honeybadger.io/notice/${notice.id}`);
});
I didn't see that covered here.
Thanks! And here's what I just realized:
I think I can just change the code to:
and skip all the block of code of objectToOverride. Then add a test to check that this hook is indeed called last. |
Okay, that sounds cool. Glad we're adding this. Hopefully we can even get rid of |
@joshuap Waiting for your feedback on this. We should also mention |
Sounds like another topic for discussion! |
On second thought, since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like the approach! See my comment below.
* change lambdaHandler wrapper to return async handler #677 * aws lambda example project * README in example project and CHANGELOG * add temp logs * fix README * throw err in afterNotify * debugging new aws lambda handler impl * debugging new aws lambda handler impl * adding logs * wip * wip * remove aws default listener * remove aws default listener * remove logs * remove logs * #327 notifyAsync (#684) * notifyAsync + tests * simplify implementation * changelog * add test * revert to original implementation + test * update tests * return isomorphic handler + tests * make input and output generic in handler * use any so users will not be forced to specify type * CHANGELOG.md * aws lambda example project, point to future version
Status
READY
Description
Related Issue: #327
I came up with a simple implementation of notify that returns a promise (notifyAsync).
It all became simple because now we always call the
afterNotify
hook, so I used it to know when to resolve/reject the promise.I decided to go for this because of our recent work on AWS Lambda (see here and here). The fire-and-forget approach does not work well with Lambda functions.
Let me know what you think.
Note: The target branch is aws_lambda_async_#677
Todos