Updater: Log additional information from ShipIt
This commit is contained in:
@@ -372,7 +372,10 @@ export async function deleteTempDir(targetDir: string): Promise<void> {
|
||||
await rimrafPromise(targetDir);
|
||||
}
|
||||
|
||||
export function getPrintableError(error: Error): Error | string {
|
||||
export function getPrintableError(error: Error | string): Error | string {
|
||||
if (typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
return error && error.stack ? error.stack : error;
|
||||
}
|
||||
|
||||
|
@@ -201,8 +201,10 @@ async function handToAutoUpdate(
|
||||
try {
|
||||
serverUrl = getServerUrl(server);
|
||||
|
||||
autoUpdater.on('error', (error: Error) => {
|
||||
logger.error('autoUpdater: error', getPrintableError(error));
|
||||
autoUpdater.on('error', (...args) => {
|
||||
logger.error('autoUpdater: error', ...args.map(getPrintableError));
|
||||
|
||||
const [error] = args;
|
||||
reject(error);
|
||||
});
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
|
Reference in New Issue
Block a user