mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 10:58:33 +00:00
fix: show notification if lib/core install failed
Closes #621 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
BoardSearch,
|
||||
sortComponents,
|
||||
SortGroup,
|
||||
platformInstallFailed,
|
||||
} from '../common/protocol';
|
||||
import {
|
||||
PlatformInstallRequest,
|
||||
@@ -474,7 +475,7 @@ export class BoardsServiceImpl
|
||||
});
|
||||
resp.on('error', (error) => {
|
||||
this.responseService.appendToOutput({
|
||||
chunk: `Failed to install platform: ${item.id}.\n`,
|
||||
chunk: `${platformInstallFailed(item.id, version)}\n`,
|
||||
});
|
||||
this.responseService.appendToOutput({
|
||||
chunk: `${error.toString()}\n`,
|
||||
|
||||
@@ -8,7 +8,10 @@ import {
|
||||
sortComponents,
|
||||
SortGroup,
|
||||
} from '../common/protocol';
|
||||
import { Installable } from '../common/protocol/installable';
|
||||
import {
|
||||
Installable,
|
||||
libraryInstallFailed,
|
||||
} from '../common/protocol/installable';
|
||||
import {
|
||||
LibraryDependency,
|
||||
LibraryLocation,
|
||||
@@ -34,6 +37,7 @@ import {
|
||||
} from './cli-protocol/cc/arduino/cli/commands/v1/lib_pb';
|
||||
import { CoreClientAware } from './core-client-provider';
|
||||
import { ExecuteWithProgress } from './grpc-progressible';
|
||||
import { ServiceError } from './service-error';
|
||||
|
||||
@injectable()
|
||||
export class LibraryServiceImpl
|
||||
@@ -272,7 +276,12 @@ export class LibraryServiceImpl
|
||||
(resolve, reject) => {
|
||||
client.libraryResolveDependencies(req, (error, resp) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
console.error('Failed to list library dependencies', error);
|
||||
// If a gRPC service error, it removes the code and the number to provider more readable error message to the user.
|
||||
const unwrappedError = ServiceError.is(error)
|
||||
? new Error(error.details)
|
||||
: error;
|
||||
reject(unwrappedError);
|
||||
return;
|
||||
}
|
||||
resolve(
|
||||
@@ -344,9 +353,7 @@ export class LibraryServiceImpl
|
||||
});
|
||||
resp.on('error', (error) => {
|
||||
this.responseService.appendToOutput({
|
||||
chunk: `Failed to install library: ${item.name}${
|
||||
version ? `:${version}` : ''
|
||||
}.\n`,
|
||||
chunk: `${libraryInstallFailed(item.name, version)}\n`,
|
||||
});
|
||||
this.responseService.appendToOutput({
|
||||
chunk: `${error.toString()}\n`,
|
||||
|
||||
Reference in New Issue
Block a user