diff --git a/packages/host/app/components/operator-mode/code-editor.gts b/packages/host/app/components/operator-mode/code-editor.gts index 61a8506bf4..55014d58d3 100644 --- a/packages/host/app/components/operator-mode/code-editor.gts +++ b/packages/host/app/components/operator-mode/code-editor.gts @@ -6,7 +6,13 @@ import { service } from '@ember/service'; import Component from '@glimmer/component'; import { cached, tracked } from '@glimmer/tracking'; -import { task, restartableTask, timeout, all } from 'ember-concurrency'; +import { + task, + restartableTask, + timeout, + all, + didCancel, +} from 'ember-concurrency'; import perform from 'ember-concurrency/helpers/perform'; @@ -471,6 +477,12 @@ export default class CodeEditor extends Component { saveType, }) .catch((error) => { + // Task cancellations are expected when the restartable contentChangedTask is + // performed again while still running - this is normal behaviour, not an error + if (didCancel(error)) { + return; + } + if (error?.status === 413 && error?.title) { this.args.onWriteError?.(error.title); return;