Skip to content
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

PUB-43: Better Error handling #39

Merged
merged 9 commits into from Jul 7, 2021

Conversation

rohit-gohri
Copy link
Member

@rohit-gohri rohit-gohri commented Jun 22, 2021

Closes PUB-43
Closes #34

@rohit-gohri rohit-gohri added the bug Something isn't working label Jun 22, 2021
@rohit-gohri rohit-gohri marked this pull request as ready for review June 28, 2021 09:08
Comment on lines +115 to +122
const subscriberInstance = new subscriberClass();
await subscriberInstance.init();
subscription.on('message', (message: GoogleCloudMessage): void => {
const subscriber = new subscriberClass();
subscriber.init();
subscriber.handleMessage(Message.fromGCloud(message)).catch(() => {
message.nack();
});
subscriberInstance
.handleMessage(Message.fromGCloud(message))
.catch(() => {
message.nack();
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in behavior that could cause possible problems if someone's usage depends on having a fresh this available in every handleMessage call.

ishan123456789
ishan123456789 previously approved these changes Jul 1, 2021
ketan-saxena
ketan-saxena previously approved these changes Jul 7, 2021
Copy link
Contributor

@ketan-saxena ketan-saxena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rohit-gohri rohit-gohri merged commit 7f1c1d3 into main Jul 7, 2021
@rohit-gohri rohit-gohri deleted the feature/PUB-43-better-error-handling branch July 7, 2021 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Informative Error Handling
3 participants