Skip to content

fix Promise error handling #7

@thescientist13

Description

@thescientist13

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
    });

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions