Skip to content

Commit

Permalink
Removing sendReport in catch, leveraging sendReport in context.fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrickard committed Jul 9, 2019
1 parent e724189 commit 914704c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,15 @@ class IOpipeWrapperClass {
typeof result.then === 'function' &&
typeof result.catch === 'function'
) {
return new Promise((resolve, reject) => {
return new Promise(resolve => {
return result
.then(value => {
this.context.succeed(value);
return this.callback(null, () => resolve(value));
})
.catch(err => {
this.context.fail(err);
this.sendReport(err, () => this.originalCallback(err));
return reject(err);
return this.callback(err);
});
});
}
Expand Down

0 comments on commit 914704c

Please sign in to comment.