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

fix Promise error handling #7

Open
5 tasks
thescientist13 opened this issue Nov 3, 2018 · 0 comments
Open
5 tasks

fix Promise error handling #7

thescientist13 opened this issue Nov 3, 2018 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@thescientist13
Copy link
Member

thescientist13 commented Nov 3, 2018

Type of Change

  • New Feature Request
  • Documentation
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Currently when there is an error returning the Promise in both scripts, the current logic doesn't actually log the error, instead it inadvertently passed a function back.

() => {
  console.error(err); // eslint-disable-line no-console
}

Details

The reject should just return the error back instead

}).on('error', (err) => {
  reject(err);
});

Also, all run blocks should make sure they catch the error, e.g.

function run() {

  getTopology()
    .then(handleIngestionResponse)
    .catch((error) => {
      console.error(error); // eslint-disable-line no-console
    });

}
@thescientist13 thescientist13 added bug Something isn't working good first issue Good for newcomers labels Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant