-
Notifications
You must be signed in to change notification settings - Fork 97
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
Stop processing next hooks #330
Comments
This is a free open source project. A tag and reminder after only 8 hours of the issue being opened isn't helpful, things like this can lead to stress for open source maintainers. I know this is probably not your intention at all! But I thought I would just mention it. :) Andris and others are already watching this repository and will receive notifications without an extra mention. |
Sorry about that. My apologies. That was not my intention. Won't happen again :) |
@andris9 It would be great if you could please look into this. |
I think @andris9 made it very clear that you need to throw an app.reject exception.
By just throwing a random Error, the plugin will be marked as failed but other plugins / hooks will continue to run. I see no issue here. Should have this closed. |
Hello,
I am throwing an error from the
sender:connection
hook, even though next hooks are called and mail is delivered.I have some condition that checks if DKIM is not available then throw the error and not proceed further hooks and drop the message but still it's processing and printing console from
sender:delivered
hook.app.addHook('sender:connection', async (delivery, options, next) => { throw new Error("No DKIM available") }
app.addHook('sender:delivered', async (delivery, info, next) => { console.log("Delivered") }
Anyone can help on how to throw the error and not processing further hooks ?
And is there any proper way to drop the message from the queue and not process that particular message ?
created issue #329 (comment) but not resolved by the solution.
Thanks.
The text was updated successfully, but these errors were encountered: