-
Notifications
You must be signed in to change notification settings - Fork 26
handle errors on local particle call #25
Conversation
src/internal/ParticleProcessor.ts
Outdated
| await this.handleParticle(particle).catch((err) => { | ||
| log.error('particle processing failed: ' + err); | ||
| const _this = this; | ||
| return new Promise(function (resolve, reject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use arrow function here. That way you won't need _this
|
|
||
| return new Promise<T>((resolve, reject) => { | ||
| const prFetch = new Promise<T>(async (resolve, reject) => { | ||
| this.fetchParticles.set(callBackId, { resolve, reject }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can drop this fetch line completely. Public fetch api works differently (see api.ts file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just a little bit of legacy left after FOSDEM preparations
| this.strategy.sendParticleFurther(newParticle); | ||
| } | ||
|
|
||
| if (stepperOutcome.ret_code == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably write something like this stepperOutcome.ret_code == 0 && resolve
No description provided.