Skip to content

Commit 8529696

Browse files
author
Akos Kitta
committed
fix: show no errors if users cancel lib install
Throwing and catching a `UserAbortError` is part of the natural flow. Closes #2063 Signed-off-by: Akos Kitta <[email protected]>
1 parent 117b2a4 commit 8529696

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: arduino-ide-extension/src/browser/widgets/component-list/filterable-list-container.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '../../../common/protocol/installable';
1414
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
1515
import { SearchBar } from './search-bar';
16-
import { ListWidget } from './list-widget';
16+
import { ListWidget, UserAbortError } from './list-widget';
1717
import { ComponentList } from './component-list';
1818
import { ListItemRenderer } from './list-item-renderer';
1919
import {
@@ -148,6 +148,11 @@ export class FilterableListContainer<
148148
try {
149149
await install({ item, progressId, version });
150150
} catch (err) {
151+
if (err instanceof UserAbortError) {
152+
// Do not toast an error message on user abort.
153+
// https://github.com/arduino/arduino-ide/issues/2063
154+
return;
155+
}
151156
const message = LibraryPackage.is(item) // TODO: this dispatch does not belong here
152157
? libraryInstallFailed(name, version)
153158
: platformInstallFailed(name, version);

0 commit comments

Comments
 (0)