Skip to content

Commit eac5020

Browse files
committed
Auto merge of #3159 - Turbo87:progress, r=pichfl
services/progress: Add missing `didCancel()` check The `updateTask` uses the `.drop()` modifier, which means it cancels automatically if there is already a running instance. This cancellation causes a `TaskCancelation` error rejection on the `perform()` call, and we should ignore that kind of error instead of reporting it to Sentry. Resolves #3157 r? `@pichfl`
2 parents 7a8c54c + 779c34b commit eac5020

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/services/progress.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
44
import Ember from 'ember';
55

66
import * as Sentry from '@sentry/browser';
7-
import { rawTimeout, task } from 'ember-concurrency';
7+
import { didCancel, rawTimeout, task } from 'ember-concurrency';
88

99
const SPEED = 200;
1010

@@ -26,8 +26,10 @@ export default class ProgressService extends Service {
2626

2727
@task(function* (promise) {
2828
this.updateTask.perform().catch(error => {
29-
// this task shouldn't be able to fail, but if it does we'll let Sentry know
30-
Sentry.captureException(error);
29+
if (!didCancel(error)) {
30+
// this task shouldn't be able to fail, but if it does we'll let Sentry know
31+
Sentry.captureException(error);
32+
}
3133
});
3234

3335
yield promise;

0 commit comments

Comments
 (0)