Skip to content

Add logic for error handling #124

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

henrymollman
Copy link
Contributor

This will remove the common 'already part of AutoScalingGroup:delta-asg-dock-pool' error that happens when shiva attempts to attach a dock to an org's asg that has not been detached from the dock pool fast enough

@@ -35,8 +35,9 @@ DockAttach.task = (job) => {
if (err.getCurrentASG() === targetASGName) {
throw new WorkerStopError('instance already attached to asg', { err, targetASGName })
}

throw err
if (!(new RegExp('is already part of AutoScalingGroup:' + process.env.DOCK_POOL_ASG_NAME).test(err.data.originalError.message))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

so we still need this worker to retry. if you do this then the worker will stop and not retry. Was you want to happen here is set err.level = debug
OR make a new error class called ignoreable or something and inherit form baseError

new BaseError('message', {}, {
  level: 'critical',      // the reporting level 
  fingerprint: 'mygroup'  // a grouping fingerprint 
})

https://www.npmjs.com/package/error-cat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants