Skip to content

Commit 1b82371

Browse files
committed
crate.version: Prevent TaskCancelation errors from being sent to Sentry
1 parent 1336a76 commit 1b82371

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/routes/crate/version.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Route from '@ember/routing/route';
22
import { inject as service } from '@ember/service';
33

44
import * as Sentry from '@sentry/browser';
5+
import { didCancel } from 'ember-concurrency';
56

67
import { AjaxError } from '../../utils/ajax';
78

@@ -44,7 +45,7 @@ export default class VersionRoute extends Route {
4445
if (!crate.documentation || crate.documentation.startsWith('https://docs.rs/')) {
4546
version.loadDocsBuildsTask.perform().catch(error => {
4647
// report unexpected errors to Sentry and ignore `ajax()` errors
47-
if (!(error instanceof AjaxError)) {
48+
if (!didCancel(error) && !(error instanceof AjaxError)) {
4849
Sentry.captureException(error);
4950
}
5051
});

0 commit comments

Comments
 (0)