ATL-653: Added error handling for core/lib install

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2021-03-10 13:24:27 +01:00
committed by Akos Kitta
parent c64ac48fe3
commit eadc993854
4 changed files with 35 additions and 3 deletions

View File

@@ -254,7 +254,11 @@ export class BoardsServiceImpl extends CoreClientAware implements BoardsService
});
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('error', reject);
resp.on('error', error => {
this.outputService.append({ chunk: `Failed to install platform: ${item.id}.\n` });
this.outputService.append({ chunk: error.toString() });
reject(error);
});
});
const items = await this.search({});

View File

@@ -183,7 +183,11 @@ export class LibraryServiceImpl extends CoreClientAware implements LibraryServic
});
await new Promise<void>((resolve, reject) => {
resp.on('end', resolve);
resp.on('error', reject);
resp.on('error', error => {
this.outputService.append({ chunk: `Failed to install library: ${item.name}${version ? `:${version}` : ''}.\n` });
this.outputService.append({ chunk: error.toString() });
reject(error);
});
});
const items = await this.search({});