mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-20 02:56:34 +00:00
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 <a.kitta@arduino.cc>
This commit is contained in:
parent
31deeebb49
commit
ee43a12eb7
@ -13,7 +13,7 @@ import {
|
|||||||
} from '../../../common/protocol/installable';
|
} from '../../../common/protocol/installable';
|
||||||
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
||||||
import { SearchBar } from './search-bar';
|
import { SearchBar } from './search-bar';
|
||||||
import { ListWidget } from './list-widget';
|
import { ListWidget, UserAbortError } from './list-widget';
|
||||||
import { ComponentList } from './component-list';
|
import { ComponentList } from './component-list';
|
||||||
import { ListItemRenderer } from './list-item-renderer';
|
import { ListItemRenderer } from './list-item-renderer';
|
||||||
import {
|
import {
|
||||||
@ -148,6 +148,11 @@ export class FilterableListContainer<
|
|||||||
try {
|
try {
|
||||||
await install({ item, progressId, version });
|
await install({ item, progressId, version });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
if (err instanceof UserAbortError) {
|
||||||
|
// Do not toast an error message on user abort.
|
||||||
|
// https://github.com/arduino/arduino-ide/issues/2063
|
||||||
|
return;
|
||||||
|
}
|
||||||
const message = LibraryPackage.is(item) // TODO: this dispatch does not belong here
|
const message = LibraryPackage.is(item) // TODO: this dispatch does not belong here
|
||||||
? libraryInstallFailed(name, version)
|
? libraryInstallFailed(name, version)
|
||||||
: platformInstallFailed(name, version);
|
: platformInstallFailed(name, version);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user